Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

prop_cycler for custom dashes -- linestyle such as (<offset>, (<on>, <off>)) throws error #5850

Copy link
Copy link
Closed
@TorbjornT

Description

@TorbjornT
Issue body actions

According to the plt.Line2D docs, you should be able to use a tuple like (<offset>, (<on>, <off>)) as a linestyle, and indeed the following works

import matplotlib.pyplot as plt
fig,ax = plt.subplots()
ax.plot([0,1],linestyle='-')
ax.plot([1,2],linestyle=(0,(3,1)))
plt.show()

However, if I try to use the same in a cycler, it doesn't work. For example with the following:

import matplotlib.pyplot as plt
from cycler import cycler
pc = cycler('linestyle', ['-', (0,(3,1))] )
fig,ax = plt.subplots()
ax.set_prop_cycle(pc)
ax.plot([0,1])
ax.plot([1,2])
plt.show()

I get the error AttributeError: 'Line2D' object has no attribute '_dashSeq'.

Is this not intended to work in the first place, or is there something wrong somewhere?

System: miniconda3, recently updated, on Kubuntu 14.04.


(Note: I posted this first as a question on StackOverflow.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.