Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

I need matplotlib's 'symlog' behaviour for pos/neg data

Hi there,

I have this data with positive X and pos&neg Y scattered such that it’s unexploitable when plotted linearly.

I started using plotly 2 weeks ago because I was so fed up with pyplot’s horrible handling of heatmaps/2dhists/plots in general. But they had this neat ‘symlog’ parameter we could set to our axes. Given a positive threshold t (e.g. 1), it displays, for every a in A:

  • log(a) if a > t
  • -log(-a) if a < -t
  • a otherwise

Just have a look around here for an example:

I’d like to have similar ticks as their example for my plot, now (-10¹, -10⁰, 0, 10⁰, 10¹). I guess I’d have to merge 3 subplots with different axes, or something similar. I’m really new to, so I’d appreciate your advice on the way to achieve my goal. I’d be happy to propose a pull request with a solution: this issue has been frustrated me for a month.

Thanks, and have a good time!


Hi, Adrien,

I requested this feature on GitHub/plotly.js on Jan 27 2016 here: [LINK]

mdtusz from commented on Jan 28

This isn’t a priority right now, but shouldn’t be too difficult to implement down the road. We’re always open to pull requests as well!

Hope they add this feature soon!

– Yi