Message Boards Message Boards

0
|
3356 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[?] Set logarithmic and reversal scaling axes?

Posted 6 years ago

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!

POSTED BY: Peter Driscoll
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 BY: Vitaliy Kaurov
Posted 6 years ago

Awesome! Thank you so much!

POSTED BY: Peter Driscoll
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