1
$\begingroup$

I'm dealing now with a problem of three steps which already has solutions in each of them. Basically, I want to write numbers on x-axis with scientific notation, but before that, I reverse the axis following this reversing plot axis for Plot, LogPlot, LogLogPlot, afterwards I add a new scale with a function relating two time scales (the x axis) following How to make plot with frame and two different scales on the x-axis (CMB power spectrum example)

  1. So first of all I defined two functions, the first one to properly reverse the plot, and the second one which give the rescaling in the axis

     ze[t_] = 10^(9)*Exp[0.68 - t] - 1;
     zp[t_] = -t + 25;
    

lets plot an arbitrary function (in my case is the solution of a system of 5 coupled ODE's)

    Needs["MaTeX`"]

    fx[t_] = 3 t - Exp[t + 2];

    Plot1 = Plot[fx[zp[t]], {t, 0, 25}, 
    PlotStyle -> {Directive[Thick, Red, DotDashed]}, Frame -> True, 
    Axes -> False, 
    FrameLabel -> {(MaTeX[#, Magnification -> 2.6] &) /@ 
    Style["\\mathcal{T}"]}, RotateLabel -> False, 
    FrameStyle -> BlackFrame, 
    BaseStyle -> {FontFamily -> "Times New Roman", FontSize -> 15
    },
   PlotLegends -> Placed[LineLegend[{
  Directive[Thick, Red, DotDashed]}, {
  (MaTeX[#, Magnification -> 1.6] &) /@ Style["f_x"]},
 LegendLayout -> {"Row", 1}, LabelStyle -> {Black, Bold, 15}, 
 LegendFunction -> Frame],
{0.46, 0.28}], ImageSize -> 400, AspectRatio -> 1, 
 FrameTicks -> {{Automatic, 
 None}, {Transpose[{Range[0, 25, 5], 
   N@ze[#] & /@ Range[0, 25, 5]}], Range[0, 25, 5]}}]

Plot1

(the gray comes from the style I'm using on the notebook). This plot then is inverted in the axis (by function zp[t]) and with and additional scale. So my problem is to put that ugly horizontal scale (reescaled by the function ze[t]) in scientific notation. I tried to used CustomTicks, but perhaps I'm missing something. Appreciate any help

$\endgroup$
  • $\begingroup$ does FrameTicks -> {{Automatic, None}, {Transpose[{Range[0, 25, 5], ScientificForm[ze[#], 2] & /@ Range[0, 25, 5]}], Range[0, 25, 5]}} give what you need? $\endgroup$ – kglr Jan 29 at 5:57
  • $\begingroup$ Dear @kglr, thanks a lot... this is almost what I want (maybe I should clarify that) Or maybe I'm adding an innecesary step. Can I just represent that scale in sort of Logaritmic one? Actualy the plot I need (with my calculations) should be LogLinearPlot. $\endgroup$ – Alejandro Guarnizo Jan 29 at 6:06
  • $\begingroup$ you mean something like this: LogLinearPlot[fx[zp@Exp[t]], {t, 1, Log@25}, PlotStyle -> {Directive[Thick, Red, DotDashed]}, Frame -> True, Axes -> False, AspectRatio -> 1]? $\endgroup$ – kglr Jan 29 at 6:13
  • $\begingroup$ or Plot[fx[t], {t, 0, 25}, PlotStyle -> {Directive[Thick, Red, DotDashed]}, Frame -> True, Axes -> False, AspectRatio -> 1, ScalingFunctions -> {"Reverse", None}]? $\endgroup$ – kglr Jan 29 at 6:34

Your Answer

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

Browse other questions tagged or ask your own question.