Does anyone have any idea how to create a logarithmic chart in FLOT?
Basically I am trying to create a chart that looks like the one shown here (top left): http://leto.net/plot/examples/logarithms.html
However, I have given it a try using the same options but it doesn't show the chart the same way. I think there must have been a lot of changes to FLOT since then considering that the post is quite old.
If anyone has any idea, please do let me know.
Thanks.
You can do this using the "transform" option on the yaxis.
See work here.
Full Working Code:
As the other answerer said, good work Mark. There is a way to make your solution more robust.
Mark's answer will work for most cases, but the plot will not look right for values near or less than 0.0001. Also, you don't need to modify every value to move away from zero. I believe that flot tries to transform 0 to determine where the "bottom" of the plot should be. Because of this, you will not be able to make your plot axis limits dynamic. This will make your plots look very bad if your values are much greater than 0.0001. Therefore, the following modification makes Mark's solution more robust, but it requires knowing the minimum y value (ymin below) in your data.
Great work Mark
As the ticks of Y axis in Logarithmic graphs are in the format of power of 10,
I would like to share enhancement in Y axis ticks, Here it is.s
Please let me know if there is any better way.
Thanks.
It is base 10. The approach it should not be?