Logarithmic and linear scale on same axis

2 visualizaciones (últimos 30 días)
James
James el 9 de Jun. de 2014
Editada: Cedric el 10 de Jun. de 2014
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 comentarios
Cedric
Cedric el 10 de Jun. de 2014
Editada: Cedric el 10 de Jun. de 2014
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.
John D'Errico
John D'Errico el 10 de Jun. de 2014
Good point by Cedric.

Iniciar sesión para comentar.

Respuestas (1)

John D'Errico
John D'Errico el 9 de Jun. de 2014
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.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by