Logarithmic and linear scale on same axis
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi all,
I have a score than ranges from 1 to -inf. From 0 to 1 the score for various things varies linearly. However if the score is below 0 it can get quite large magnitudes. My aim is to be able to plot these scores such that the y axis varies linearly above 0 and logarithmically below 0. Can anyone help with this?
Thanks,
James
댓글 수: 2
Cedric
2014년 6월 10일
편집: Cedric
2014년 6월 10일
Here is a hint
Where would your representation of negative numbers connect with the representation of positive numbers? If you want/need a smooth transition between the two, they should connect at one point (0 according to your specification). This means that there must be a specific value of x at which you can pass from the blue curve to the red curve in a continuous fashion. Yet, if you look at the graph of what would be a trivial linear scale and a log base 10 scale, there is no such point.
Now you can try to find a transformation which which connects, but your scale wont be as simple as a linear increments of exponents of 10. Yet you can compute the location of exponents of 10, and place ticks and appropriate labels at these positions. But it is not direct and you would have to work a bit for that.
답변 (1개)
John D'Errico
2014년 6월 9일
It would be impossible to find a tool that would do this for you. And how many people want to do that anyway. That limits the potential to find a tool to do it.
HOWEVER, nothing stops you from doing it.
1. Transform your variable, so that it has the properties you want. Note that this is not a unique transformation, since each part of the linear/log transform will be scaled differently.
2. Plot
3. Set the ticks where you want them, labeled based on the transform you chose.
Not trivial, but not that difficult either.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!