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.

Custom values for `griddash`, e.g. '10px' don't work (plotly.js 2.12.0)

See original GitHub issue

Custom 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:closed
  • Created a year ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

3reactions
nicolaskruchtencommented, May 9, 2022

Let’s fix this in the next patch release. I’m almost done QA’ing 5.8.0 already.

1reaction
nicolaskruchtencommented, May 9, 2022

Could you simply set it to 10px?

yes that works also

Read more comments on GitHub >

github_iconTop 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 >

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