Repository navigation
annotations aren't plotted properly on log axes #1258
Description
Activity
Unfortunately. you have to
Math.log10thex/yposition https://codepen.io/alexcjohnson/pen/yLGPgdEYou shouldn't have to do this, but there's no way for us to fix this is in a backward compatible way.
Reacted by Chelsea Douglas, Nate George, RealJTG and AtharvaKatre@etpinard Your solution is wrong ,, you must use: Math.log(x)/ Math.log(10) because Math.log is base E.
Reacted by Athul Nair and Christian Tooleyor use
Math.log10.thanks @ricardovb
Reacted by Athul Nair, Samuel Croset and CZThe same Bug on Plotly for R. Solved in the same way. Thank you!
Ran into this today - thanks for the workaround!
Another option occurred to me while responding to @orenbenkiki's suggestion plotly/dash#916 (comment) - we could imagine adding a new axis attribute like
coordinates: 'legacy'|'data'to opt into the "v2" behavior.I actually suggested adding a value to the
refattributes:xref='X'orxref='x!'orxref='x_with_transformations'or something along these lines. Adding a new attribute might be cleaner, though.Reacted by RealJTG and Surya KrishnamurthyThe above suggestions of using the log of the value to make the annotation do not work either when using log axes and adding an hline with annotation:
fig.add_hline( y=1E6, line_color="red", annotation_text="Lower limit", annotation_position="top left", )
The hline is drawn at the correct place, but the annotation is shown a some monstrously large value on the y-axis. How would one go about fixing this?Reacted by Ben Mares, Jonathan O'Connell and Tilman HoffbauerHere is another example of how poorly log coordinates work:
https://community.plotly.com/t/wrong-annotation-location-of-vrect-on-log-graph/58550/2Unfortunately. you have to
Math.logthex/yposition http://codepen.io/etpinard/pen/oYJwLxYou shouldn't have to do this, but there's no way for us to fix this is in a backward compatible way.
Seems like this example is broken by now.
Oh that example is using the wrong flavor of log, should be log10 https://codepen.io/alexcjohnson/pen/yLGPgdE - thanks @Turakar
Looks like annotations don't show up at the expected coordinates when axes are
type: 'log'example: http://codepen.io/plotly/pen/dOwRyG