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.

Line colorscale on scatter graph

See original GitHub issue

Hello,

I can’t make work the marker.line.colorscale property. I’m not sure how it should work, but what I can say is:

  • using the colorscale property on lines as it is used on markers has no effect
  • if we use the property on a scatter graph with both lines and markers we have a bug (or I’m not using it properly?)

So is it possible to color a line following a colorscale on a scatter graph? How we do it?

Moreover the documentation is confusing, as it states the property line is under the mark one:

Sets the colorscale and only has an effect if marker.line.color is set to a numerical array.

Actually it seems not to be the case: http://codepen.io/anon/pen/OXJErp. Should the documentation states line.color instead?

I can do a PR to fix the doc, but I want to be sure I’m not misleading first.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:27 (17 by maintainers)

github_iconTop GitHub Comments

11reactions
alexlenailcommented, Jun 10, 2021

Just here to note that I’d love to see this feature available in 2D.

10reactions
etpinardcommented, May 30, 2016

Thanks for the very detailed issue.

In plotly.js, attributes under marker.line describe the marker points’ bordering line styling (example here) and have no effect on a scatter trace’s line segments.

At the moment, scatter line attributes do not support color scales nor per-data-point style setting (as mentioned in https://github.com/plotly/plotly.js/issues/147). In other words, there is no way to apply a colour gradient to a plotly.js line chart.

Adding color scale support to line charts (possibly using svg gradient) would be a great addition to the library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a gradient-colored scatter plot with color scale in ...
To display a scatter plot with data-based coloring and show a color scale for these points, complete the steps below: Select the scatter...
Read more >
Scatter and line plots in R - Plotly
How to create line and scatter plots in R. Examples of basic and advanced scatter plots, time series line plots, colored charts, and...
Read more >
Matplotlib - plot lines using same colormap as scatter
Solution seems to set up a scalarMap and use normalize ... import numpy as np import matplotlib.pyplot as plt %config ...
Read more >
Colored line or scatter plot - File Exchange - MATLAB Central
plots a 2-D "line" with c-data as color. Makes a surface object and the colouring is controlled by the colormap. Examples: x =...
Read more >
How to Color Scatter Plot Points in R ? - GeeksforGeeks
Now to change the colors of a scatterplot using plot(), simply select the column on basis of which different colors should be assigned...
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