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

allow fillstyle 'none' option#447

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
efiring merged 10 commits intomatplotlib:masterfromcragm:fillstyle_none
Dec 31, 2011
Merged

allow fillstyle 'none' option#447

efiring merged 10 commits intomatplotlib:masterfromcragm:fillstyle_none
Dec 31, 2011

Conversation

cragm
Copy link
Contributor

The fillstyle property currently allows full- and half-filling (top|bottom|left|right) of relevant markers. To the best of my understanding, creating an unfilled (i.e. just an outline) marker currently requires setting markerfacecolor to 'none' and markeredgecolor to the color of your choice (if you don't want black).

In the interest of consistency, I added a fillstyle 'none' option to allow creation of unfilled markers using the same interface as the other filling options.

In this implementation, when fillstyle=='none' and markerfacecolor == 'auto', the color returned by _get_markerfacecolor is 'none', as opposed to self._color in the original code. Similarly, when fillstyle=='none' and markeredgecolor == 'auto', the color returned by get_markeredgecolor is self._color, rather than 'k'.

Note that this means setting markerfacecolor to something other than 'none' or 'auto' will generally result in a filled marker even when fillstyle=='none'. Giving fillstyle priority when returning markerfacecolor was another option, but I wasn't comfortable with masking a manual setting. There may exist better ways to handle this.

@jdh2358
Copy link
Collaborator

You have 7 or so lines which read "if fs == 'full' or fs == 'none':" in markers.py. This looks like a good candidate for a local function.

@mdboom
Copy link
Member

If you wouldn't mind incorporating@jdh2358's suggestion, I think this pull would be ready to merge.

efiring added a commit that referenced this pull requestDec 31, 2011
@efiringefiring merged commit1afa742 intomatplotlib:masterDec 31, 2011
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestNov 24, 2020
This is brittle, but matches the behavior in Line2D.MarkerStyle objects have two coupled, but not fully redundant methodsfor determining if the maker is filled: the `is_filled` and`get_fillstyle` methods.  If `ms.get_fillstyle() == 'none'` then`ms.is_filled() is False`, however the converse is not True.  Inparticular the markers that can not be filled (because the Paths theyare made out of can not be closed) have `ms.get_fillstyle() == 'full'`and `ms.is_filled() is False`.  In Line2D we filter on the value of`get_fillstyle` not on `is_filled` so do the same in `Axes.scatter`.In Line2D we do the validation at draw time (because Line2D holds ontoits MarkerStyle object instead of just extracting the path).The logic for fillstyle on Markers came in viamatplotlib#447/213459e.closesmatplotlib#17849Revisesmatplotlib#17543 /d86cc2b
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestNov 24, 2020
This is brittle, but matches the behavior in Line2D.MarkerStyle objects have two coupled, but not fully redundant methodsfor determining if the maker is filled: the `is_filled` and`get_fillstyle` methods.  If `ms.get_fillstyle() == 'none'` then`ms.is_filled() is False`, however the converse is not True.  Inparticular the markers that can not be filled (because the Paths theyare made out of can not be closed) have `ms.get_fillstyle() == 'full'`and `ms.is_filled() is False`.  In Line2D we filter on the value of`get_fillstyle` not on `is_filled` so do the same in `Axes.scatter`.In Line2D we do the validation at draw time (because Line2D holds ontoits MarkerStyle object instead of just extracting the path).The logic for fillstyle on Markers came in viamatplotlib#447/213459e.closesmatplotlib#17849Revisesmatplotlib#17543 /d86cc2b
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJan 21, 2021
This is brittle, but matches the behavior in Line2D.MarkerStyle objects have two coupled, but not fully redundant methodsfor determining if the maker is filled: the `is_filled` and`get_fillstyle` methods.  If `ms.get_fillstyle() == 'none'` then`ms.is_filled() is False`, however the converse is not True.  Inparticular the markers that can not be filled (because the Paths theyare made out of can not be closed) have `ms.get_fillstyle() == 'full'`and `ms.is_filled() is False`.  In Line2D we filter on the value of`get_fillstyle` not on `is_filled` so do the same in `Axes.scatter`.In Line2D we do the validation at draw time (because Line2D holds ontoits MarkerStyle object instead of just extracting the path).The logic for fillstyle on Markers came in viamatplotlib#447/213459e.closesmatplotlib#17849Revisesmatplotlib#17543 /d86cc2b
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJan 22, 2021
This is brittle, but matches the behavior in Line2D.MarkerStyle objects have two coupled, but not fully redundant methodsfor determining if the maker is filled: the `is_filled` and`get_fillstyle` methods.  If `ms.get_fillstyle() == 'none'` then`ms.is_filled() is False`, however the converse is not True.  Inparticular the markers that can not be filled (because the Paths theyare made out of can not be closed) have `ms.get_fillstyle() == 'full'`and `ms.is_filled() is False`.  In Line2D we filter on the value of`get_fillstyle` not on `is_filled` so do the same in `Axes.scatter`.In Line2D we do the validation at draw time (because Line2D holds ontoits MarkerStyle object instead of just extracting the path).The logic for fillstyle on Markers came in viamatplotlib#447/213459e.closesmatplotlib#17849Revisesmatplotlib#17543 /d86cc2bCo-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJan 29, 2021
This is brittle, but matches the behavior in Line2D.MarkerStyle objects have two coupled, but not fully redundant methodsfor determining if the maker is filled: the `is_filled` and`get_fillstyle` methods.  If `ms.get_fillstyle() == 'none'` then`ms.is_filled() is False`, however the converse is not True.  Inparticular the markers that can not be filled (because the Paths theyare made out of can not be closed) have `ms.get_fillstyle() == 'full'`and `ms.is_filled() is False`.  In Line2D we filter on the value of`get_fillstyle` not on `is_filled` so do the same in `Axes.scatter`.In Line2D we do the validation at draw time (because Line2D holds ontoits MarkerStyle object instead of just extracting the path).The logic for fillstyle on Markers came in viamatplotlib#447/213459e.closesmatplotlib#17849Revisesmatplotlib#17543 /d86cc2bCo-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>Co-authored-by: Jody Klymak <jklymak@gmail.com>Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@cragm@jdh2358@mdboom@efiring

[8]ページ先頭

©2009-2025 Movatter.jp