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

[ENH]: Request for linestyle='.' and linestyle='.-' in plt.plot #28245

Open
Hari-Shankar-Karthik opened this issue May 17, 2024 · 1 comment
Open

Comments

@Hari-Shankar-Karthik
Copy link

Problem

It gets difficult to remember whether it is ls='-.' or ls='.-' for the alternating dash and dot linestyle in plt.plot. Similarly for the dotted line, I feel that ls='.' makes far more sense than ls=':'.

Proposed solution

It is a really simple fix. All one needs to do is add appropriate OR conditions in the correct places. I would be happy to do it if you would allow so. Thanks!

@Hari-Shankar-Karthik Hari-Shankar-Karthik changed the title Request for linestyle='.' and linestyle='.-' in plt.plot [ENH: ] Request for linestyle='.' and linestyle='.-' in plt.plot May 17, 2024
@Hari-Shankar-Karthik Hari-Shankar-Karthik changed the title [ENH: ] Request for linestyle='.' and linestyle='.-' in plt.plot [ENH]: Request for linestyle='.' and linestyle='.-' in plt.plot May 17, 2024
@timhoffm
Copy link
Member

timhoffm commented May 17, 2024

Thanks for the suggestion.

Note that the long name is "dashdot" (which is consistent with TeX and MATLAB), so "-." makes sense. I'm +/-0 on adding '.-', but I'm inclined if we do that, it should not be an alias, but the line should start with the dot then as well.

I'm -1 on adding '.' as an alias to ':'. While plot(x, y, ls='.') could be made to work. The shorthand markerformat plot(x, y, '.') is already reserved for the dot-marker, so it would not work there and that incongruence would be more confusing than just having to learn ':' is the shorthand for a dotted line.

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

No branches or pull requests

2 participants