Imagine I have two lists:


And I want a listplot


Would do the job. What can I do if I want a plot with the order of the x axis shifted? Something like: instead of the latter code, it'd read


This comes from HR diagrams, in where Temperature decreases as "the x axis grows".

Specifically, I have this plot:

rough HR diagram attempt

And I'd like to invert $\log T$ from $~4.4$ to $~3.5$

The code is

ListPlot[Transpose[{temp, lum}], PlotRange -> Full, 
 PlotTheme -> "Detailed", PlotStyle -> {Automatic, Green}, 
 AxesLabel -> Automatic, Frame -> True, 
 FrameLabel -> {Style["Temperatura Log T [K]", FontSize -> 22, Bold], 
   Style["Luminosidad Log L [\!\(\*SubscriptBox[\(L\), \(sol\)]\)]", 
    FontSize -> 22, Bold]}, ImageSize -> Large]

Thanks in advance.

  • 1
    $\begingroup$ {temp//Reverse, lum}] ? $\endgroup$
    – cvgmt
    Commented Oct 11, 2020 at 23:26

1 Answer 1


How about:

data = Table[{x, x^2}, {x, 0, 5}];

ListLinePlot[data, ScalingFunctions -> {"Reverse", Identity}]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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