1
$\begingroup$

I have this code but I don't know how can I put the y-axis in a logarithmic form (I need to put it in a base 2 logarithm and in the default Log of mathematica), because there is an incompatibility between LogPlot and ListLogPlot with the option ScalingFunction "Reverse". I hope you can help me. The code is the following:

data1 = {{0.18170805572380375`,10.66}, {0.18170805572380375`,10.6925}, {0.18170805572380375`,10.725}, {0.18170805572380375`,10.7575}, {0.18170805572380375`,10.79}, {0.18170805572380375`,10.8225}, {0.18170805572380375`,10.855}, {0.18170805572380375`,10.8875}, {0.17947950942267424`,11.2125}, {0.17947950942267424`,11.5375}, {0.17947950942267424`,11.83}, {0.17730496453900707`,12.1875}, {0.17730496453900707`,12.51255}, {0.17730496453900707`,12.7075}, {0.17730496453900707`, 12.8375}, {0.1751824817518248`, 13.065}, {0.1751824817518248`, 13.4875}, {0.1751824817518248`, 13.8125}, {0.1751824817518248`, 14.1375}, {0.17311021350259664`,14.4625}, {0.17311021350259664`, 14.7875}, {0.17108639863130878`,16.0875}, {0.1691093573844419`, 18.6875}, {0.1691093573844419`,21.9375}, {0.16717748676511562`, 25.1875}, {0.16717748676511562`,27.4625}, {0.16717748676511562`, 29.0875}, {0.16528925619834708`,30.0625}, {0.16528925619834708`, 31.3625}, {0.16528925619834708`,33.9625}, {0.16528925619834708`, 36.5625}};
data2 = {{0.11846001974333663`, 10.66}, {0.11657276083155237`,10.6925}, {0.11565150346954509` , 10.725}, {0.11385199240986715`,10.7575}, {0.1129730747505178`, 10.79}, {0.11125533098460968`,10.8225}, {0.11041589988958408`, 10.855}, {0.10877447425670773`,10.8875}, {0.10055304172951232`, 11.2125}, { 0.09408812921436412`,11.5375}, {0.08894159501927067`, 11.83}, {0.08432888264230498`,12.1875}, {0.08017103153393906`, 12.5125}, {0.07845188284518828`,12.7075}, {0.07680491551459293`, 12.8375}, {0.07484096295372333`,13.065}, {0.07119971520113919`, 13.4875}, { 0.06853226727584237`,13.8125}, {0.06635700066357`, 14.1375}, {0.06403415154749198`,14.4625},{0.06213109661385523`,14.7875}, {0.055319933616079654`, 16.0875}, {0.04537205081669691`,18.6875}, {0.037091988130563795`,21.9375}, {0.03143500812071043`, 25.1875}, {0.028386242134645405`,27.4625}, {0.026581605528973946`,29.0875}, {0.025560194257476354`,30.0625}, {0.024368450978799448`, 31.3625}, {0.02225601839830854`,33.9625}};
Show[Plot[7.672566821271195` + 0.19053345681644884`/t^1.3`, {t, 0, 0.18251}, PlotRange -> {{0, 0.2}, {0, 50}}, AxesOrigin -> {0, 50},ScalingFunctions -> "Reverse", AxesStyle -> {Directive[Black, Thick], Directive[Black, Thick]},  TicksStyle -> {{FontSize -> 20, Black}, {FontSize -> 20, Black}}, LabelStyle -> {Directive[22, "Times", Red, Bold]},PlotStyle -> {Blue,Thickness[.008]},AxesLabel -> {Style[Text["  \!\(\*SuperscriptBox[\(\[Beta]\), \(-1\)]\) "], FontSize -> 26, Bold, Black],Style[Text["  L "], FontSize -> 26, Italic, Bold, Black]}, PlotRange ->{{0, 0.20}, {0, 50}}],Plot[-2.381937082936315` Tan[9.946572527751202486`3. t], {t, 0,0.18251}, PlotRange -> {0, 50}, AxesOrigin -> {0, 50},ScalingFunctions -> "Reverse",AxesStyle -> {Directive[Black, Thick], Directive[Black, Thick]},TicksStyle -> {{FontSize -> 20, Black}, {FontSize -> 20, Black}},LabelStyle -> {Directive[22, "Times", Red, Bold]}, PlotStyle -> {Red,Thickness[.008]},AxesLabel -> {Style[Text["  \!\(\*SuperscriptBox[\(\[Beta]\), \(-1\)]\) "],FontSize -> 26, Bold, Black],Style[Text[" L"], FontSize -> 26, Italic, Bold, Black]},PlotRange -> {{0, 0.20}, {0, 50}}],ListPlot[{data1, data2},PlotStyle -> {{Black,PointSize[0.010]},{Black, PointSize[0.012]}},AxesStyle -> {Directive[Black, Thick], Directive[Black, Thick]},TicksStyle -> {{FontSize -> 20, Black}, {FontSize ->20, Black}},AxesLabel -> {Style[Text["\!\(\*SuperscriptBox[\(\[Beta]\), \(-1\)]\) "],FontSize -> 26, Bold, Black],Style[Text[" L"], FontSize -> 26, Italic, Bold, Black]},PlotRange -> {{0, 0.20}, {0, 50}}, AxesOrigin -> {0, 50},ScalingFunctions -> "Reverse"]]
$\endgroup$
1
$\begingroup$
Show[
  Plot[Log2[7.672566821271195 + 0.19053345681644884/t^1.3], {t, 0, 0.18251},
     ScalingFunctions -> "Reverse",
     PlotRange -> {{0, 0.2}, Log2@{1, 50}},
     AxesOrigin -> {0, Log2@50},
     AxesStyle -> {Directive[Black, Thick], Directive[Black, Thick]},
     TicksStyle -> {{FontSize -> 20, Black}, {FontSize -> 20, Black}},
     Ticks -> {Automatic, Thread[{Log2@#, #}] &[Round[2^Range[#, #2, (#2 - #)/6]]] &},
     LabelStyle -> {Directive[22, "Times", Red, Bold]},
     PlotStyle -> {Blue, Thickness[.008]},
     AxesLabel -> {Style[Text["  \!\(\*SuperscriptBox[\(\[Beta]\), \(-1\)]\) "], FontSize -> 26, Bold, Black], Style[Text["  L "], FontSize -> 26, Italic, Bold, Black]}], 
  Plot[Log2[-2.381937082936315 Tan[9.946572527751202486`3. t]], {t, 0, 0.18251},
     ScalingFunctions -> "Reverse",
     PlotStyle -> {Red, Thickness[.008]},
     PlotRange -> {{0, 0.20}, Log2@{1, 50}}],
  ListPlot[MapAt[Log2, {data1, data2}, {All, All, 2}],
     ScalingFunctions -> "Reverse",
     PlotStyle -> {{Black, PointSize[0.010]}, {Black, PointSize[0.012]}},
     PlotRange -> {{0, 0.20}, Log2@{1, 50}}]]
$\endgroup$
  • $\begingroup$ Thank you Coolwater $\endgroup$ – Michaels Jul 18 '17 at 16:13
  • $\begingroup$ In the code above, to put it in the default Log of Mathematica is it sufficient to erase the 2 behind the Log2? $\endgroup$ – Michaels Jul 18 '17 at 16:23
  • $\begingroup$ You also need to change &[Round[2^Range to &[Round[E^Range $\endgroup$ – Coolwater Jul 18 '17 at 16:45
  • $\begingroup$ Ok, Thank you Coolwater $\endgroup$ – Michaels Jul 18 '17 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.