Skip to content
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

[Bug]: LineCollection, set_linestyle does not work #28545

Closed
jonpro142 opened this issue Jul 12, 2024 · 3 comments
Closed

[Bug]: LineCollection, set_linestyle does not work #28545

jonpro142 opened this issue Jul 12, 2024 · 3 comments

Comments

@jonpro142
Copy link

jonpro142 commented Jul 12, 2024

Bug summary

in the class LineCollection, the argument linestyle has no effect neither if set directly or if set afterwards with set_linestyle or with set(linestyle='--')
set_color does work. maybe its just linestyle that doesnt.

Code for reproduction

coord_start = np.column_stack((x_midpts[:-1], y_midpts[:-1]))[:, np.newaxis, :]
coord_mid = np.column_stack((x, y))[:, np.newaxis, :]
coord_end = np.column_stack((x_midpts[1:], y_midpts[1:]))[:, np.newaxis, :]
segments = np.concatenate((coord_start, coord_mid, coord_end), axis=1)

lc = LineCollection(segments, **default_kwargs)
#lc.set_array(values)  # set the colors of each segment
#lc.set_linestyle(':')
#lc.set_color(c)
lc.set(color=c, linestyle='--')

Actual outcome

linestyle doesnt change

Expected outcome

linestyle should change to the type i gave as input

Additional information

No response

Operating system

No response

Matplotlib Version

3.5.3 and 3.9.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

@jonpro142
Copy link
Author

or is that simply an optical illusion if the lines within the collections are too small to see the acutal pattern?

@timhoffm
Copy link
Member

Please provide a fully self-contained example. We cannot judge based on an incomplete code snippet.

@jonpro142 jonpro142 reopened this Jul 12, 2024
@jonpro142
Copy link
Author

It was only because the lines within the collection were so small, that you couldnt see the acutal style of each line

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

2 participants