question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shared colorscales/colorbars aka coloraxes

See original GitHub issue

Right now traces can share axes but not colorbars. It would be nice if they could, something like data[].coloraxis = "color1" with layout.coloraxis1 = { ... } and all bounds-computations could include the union of the data of the traces, etc

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
alexcjohnsoncommented, Apr 18, 2019

I feel like we do this in a bunch of situations, but one that comes to mind right now is scaleanchor, we’ll ignore it if the referenced axis is the wrong type.

If we reject a coloraxis setting, that trace would have no coloraxis so it would behave like all traces do right now - the trace defines its own colorscale and colorbar.

1reaction
alexcjohnsoncommented, Apr 18, 2019

Contours with coloring: 'heatmap' would work just fine already - the colorbar would have lines on it for the contours I guess, which wouldn’t match the heatmap, but that’s probably OK. And contours with coloring: 'lines' (or 'none') I don’t see any sense allowing to share a colorbar with heatmaps. So we’re only talking about coloring: 'fills'. But since we have to exclude 'lines' and 'none' already, I’d argue for excluding 'fills' too - and only allow contours with coloring: 'heatmap' to share a scale with a heatmap - until we manage to do “discrete” right.

FWIW “discrete” itself has two variants that we need to be careful about. The version used in contour plots defines data values at the edges of each color - where the contour lines are. Much of the time heatmaps (and choropleths, scatter marker colors…) with discrete colors don’t do that kind of mapping, they simply have discrete data and they map a single value to a single color. As far as the colorbar is concerned the main distinction is where the labels go: at the color boundaries vs midpoints. For the boundaries case we will need changes to trace rendering code, for the discrete data case we’ll need changes to the colorbar rendering (and maybe trace rendering changes, if we want to also collapse multiple values onto one color)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layout.coloraxis in Python - Plotly
Type: dict containing one or more of the keys listed below. ... Determines whether the colorscale is a default palette (`autocolorscale: True`) or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found