Custom values for `griddash`, e.g. '10px' don't work (plotly.js 2.12.0)
See original GitHub issueCustom values for griddash
, e.g. ‘10px’ don’t work (plotly.js 2.12.0)
Example:
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", facet_col="species")
fig.update_xaxes(tickcolor="black", tickwidth=2, ticklen=10, ticklabelmode="period", griddash='10px')
fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='LightPink')
fig.show()
Gives the following error
ValueError:
Invalid value of type 'builtins.str' received for the 'griddash' property of layout.xaxis
Received value: '10px'
The 'griddash' property is a string and must be specified as:
- One of the following strings:
['solid', 'dot', 'dash', 'longdash', 'dashdot',
'longdashdot']
- A number that will be converted to a string
@archmoj, should it work like this? That throws an error
fig.update_xaxes(showgrid=True, gridwidth=1, gridcolor='LightPink', griddash='10px')
_Originally posted by @LiamConnors in https://github.com/plotly/plotly.py/pull/3693#discussion_r865489690_
Issue Analytics
- State:
- Created a year ago
- Comments:22 (22 by maintainers)
Top Results From Across the Web
Configuration options in JavaScript - Plotly
Over 45 examples of Configuration Options including changing color, size, log axes, and more in JavaScript.
Read more >Adding CSS & JS and Overriding the Page-Load Template
Dash supports adding custom CSS or JavaScript in your apps. Create a folder named assets in the root of your app directory and...
Read more >plotly.graph_objects.Layout — 5.11.0 documentation
With “fraction”, the value of each bar is divided by the sum of all values at ... or “longdashdot”) or a dash length...
Read more >Axes in JavaScript - Plotly
js -based javascript charts. Seven examples of linear and logarithmic axes, axes titles, and styling and coloring axes and grid lines. New to...
Read more >JavaScript Figure Reference: layout.yaxis - Plotly
Set to a dash type string ("solid", "dot", "dash", "longdash", "dashdot", or "longdashdot") or a dash length list in px (eg "5px,10px,2px,2px"). gridwidth...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Let’s fix this in the next patch release. I’m almost done QA’ing 5.8.0 already.
yes that works also