Plotly.js: annotations aren't plotted properly on log axes

Created on 16 Dec 2016  路  7Comments  路  Source: plotly/plotly.js

Looks like annotations don't show up at the expected coordinates when axes are type: 'log'

example: http://codepen.io/plotly/pen/dOwRyG

bug

Most helpful comment

Unfortunately. you have to Math.log the x/y position http://codepen.io/etpinard/pen/oYJwLx

You shouldn't have to do this, but there's no way for us to _fix_ this is in a backward compatible way.

All 7 comments

Unfortunately. you have to Math.log the x/y position http://codepen.io/etpinard/pen/oYJwLx

You shouldn't have to do this, but there's no way for us to _fix_ this is in a backward compatible way.

@etpinard Your solution is wrong ,, you must use: Math.log(x)/ Math.log(10) because Math.log is base E.

or use Math.log10.

thanks @ricardovb

The 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 https://github.com/plotly/dash/issues/916#issuecomment-529764218 - 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 ref attributes: xref='X' or xref='x!' or xref='x_with_transformations' or something along these lines. Adding a new attribute might be cleaner, though.

Was this page helpful?
0 / 5 - 0 ratings