Message Boards Message Boards

GROUPS:

[✓] Set logarithmic and reversal scaling axes?

Posted 7 months ago
560 Views
|
2 Replies
|
2 Total Likes
|

I'm trying to create a Hertzsprung-Russell Diagram which requires both axes to be logarithmic and the x-axis to be reversed. I've found the ScalingFunctions option for the ListPlot command, but it can only seem to do one change to each axes at a time ({"Log","Log"} or {"Reverse","Log"}).

Are there any other methods of manipulating axes or a way to get an extra change out of the ScalingFunctions option?

Thanks!

2 Replies

If you read carefully docs on ScalingFunctions especially last example, you will see arbitrary well-defined functions can be applied to scaling.

enter image description here

Did you try that? For instance:

data=Transpose[Table[Sort[RandomReal[{1,1000},100]],2]];
ListPlot[data,
    PlotTheme->"Detailed",
    ScalingFunctions->{
       {-Log[#]&,InverseFunction[-Log[#]&]},
       {Log,InverseFunction[Log]}}]

enter image description here

Posted 7 months ago

Awesome! Thank you so much!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract