Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rendering of Matplotlib linestyle=':' needs to be updated in par with 'dash' property #1123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
priyatharsan opened this issue Aug 20, 2018 · 2 comments

Comments

@priyatharsan
Copy link
Contributor

priyatharsan commented Aug 20, 2018

Code sample:

ax4.plot(y4 * points, linestyle=':', color=color, linewidth=3)
ax4.set_xlabel('Line Type :')

plotly_fig = tls.mpl_to_plotly( fig )

The error message is:

ValueError: 
    Invalid value of type '__builtin__.str' received for the 'dash' property of scatter.line
        Received value: 'circle'

    The 'dash' 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
@priyatharsan priyatharsan changed the title Rendering of Matplotlib linestyle=':' needs to be update in par with 'dash' property Rendering of Matplotlib linestyle=':' needs to be updated in par with 'dash' property Aug 20, 2018
@jonmmease jonmmease added the bug something broken label Aug 22, 2018
@jonmmease jonmmease removed the bug something broken label Sep 23, 2018
@MeraX
Copy link

MeraX commented Mar 19, 2019

I think I encountered a related bug:
Self contained code sample:

import plotly.offline
import matplotlib.pyplot as plt
import matplotlib
import plotly

print('using matplotlib', matplotlib.__version__, 'and plotly', plotly.__version__)

x = range(10)

fig, ax = plt.subplots()
ax.plot(x, x, linestyle=':', linewidth=2)
plotly.offline.plot_mpl(fig) 

using matplotlib 2.2.0 and plotly 3.7.0

Error:

ValueError: 
    Invalid value of type 'builtins.str' received for the 'dash' property of scatter.line
        Received value: 'dotted'

    The 'dash' property is an enumeration that may be specified as:
      - One of the following dash styles:
            ['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot']
      - A string containing a dash length list in pixels or percentages
            (e.g. '5px 10px 2px 2px', '5, 10, 2, 2', '10% 20% 40%', etc.)

I have no clue, what is going on here, but the problem is linewidth=2 in my case. Any other value like 2.1, 1.5, 3, etc. worked for me, but 2 triggers this error.

@gvwilson
Copy link
Contributor

Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, so I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants