Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[DOC] Example of user-defined linestyle (TikZ linestyle)#7087

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 3 commits intomatplotlib:masterfromrougier:linestyle
Sep 14, 2016

Conversation

rougier
Copy link
Member

This is an example showing user-defined linestyle copying name and style of TikZ.

linestyles

color="blue", family="monospace")

plt.tight_layout()
# plt.savefig("linestyles.pdf")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd remove those two lines, thought I honestly don't have a strong feeling about it.

@NelleV
Copy link
Member

Thanks again for a very nice addition to the gallery.

@rougier
Copy link
MemberAuthor

rougier commentedSep 10, 2016
edited
Loading

This could be the base for new linestyles (MEP ?):

NameLinestyleValue
-Solid(0, ())
.:denseDensely dotted(0, (1, 1))
.:normal or.Dotted(0, (1, 5))
.:looseLoosely dotted(0, (1, 10))
--:denseDensely dashed(0, (5, 1))
--:normal or--Dashed(0, (5, 5))
--:looseLoosely dashed(0, (5, 10))
-.:denseDensely dashdotted(0, (3, 1, 1, 1))
-.:normal or-.Dashdotted(0, (3, 5, 1, 5))
-.:looseLoosely dashdotted(0, (3, 10, 1, 10))
-..:denseDensely Dashdotdotted(0, (3, 1, 1, 1, 1, 1))
-..:normal or-..Dashdotdotted(0, (3, 5, 1, 5, 1, 5))
-..:looseLoosely Dashdotdotted(0, (3, 10, 1, 10, 1, 10))

@afvincent
Copy link
Contributor

I mention this just in case: there was some discussion related to line style patterns in#6547 a while ago, and the values that were chosen for the '-', ':' and '-.' line styles are a bit different.

Personally, I think it may be a good idea to add some extra default line styles like this PR suggest. Quite often, I wish there was (at least) a "dashdotdotted" style available.

About the example, I would have 2 remarks:

  • it might be confusing to use the names "dotted", "dashdotted" and "dashed" for styles that do not use the default values.
  • is it necessary to useplt.xticksandplt.yticks instead of the OO methodsax.set_xticks andax.set_yticks?

Apart from these, I find the example to be very nice, as it may provide to the users some ready-to-use values for line style patterns, without having them to try a bunch of values on their own (like I often did...)

@rougier
Copy link
MemberAuthor

@afvincent Thanks for the review.

  1. The names come from TikZ actually.
  2. No reason to useplt.xticks, I need to change that.
  3. Dotted /dashed: I didn't know what are the default values so I tried to guess them

Also thanks for the link to the PR. Do you now if there's a way to have round caps in 2.0 ?

@rougier
Copy link
MemberAuthor

Actually it doesn't work withax.set_yaxis()

@tacaswell
Copy link
Member

Line2D.set_dash_capstyle

http://matplotlib.org/api/lines_api.html#module-matplotlib.lines

There is also adash_jointstyle

@tacaswelltacaswell added this to the2.0 (style change major release) milestoneSep 11, 2016
@rougier
Copy link
MemberAuthor

@tacaswell Thanks. I would (personally) prefer round caps by defaults but I imagine it has been already discussed.

@rougier
Copy link
MemberAuthor

Is there anything else to do with this PR ?

@tacaswelltacaswell merged commit5fb331b intomatplotlib:masterSep 14, 2016
tacaswell added a commit that referenced this pull requestSep 14, 2016
DOC: Example of user-defined linestyle (TikZ linestyle)
@tacaswell
Copy link
Member

backported to v2.x as7ed77e4

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
v2.0.0
Development

Successfully merging this pull request may close these issues.

5 participants
@rougier@NelleV@afvincent@tacaswell@mdboom

[8]ページ先頭

©2009-2025 Movatter.jp