Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 31, 2011
Merged

allow fillstyle 'none' option #447

merged 10 commits into from
Dec 31, 2011

Conversation

cragm
Copy link
Contributor

@cragm cragm commented Aug 31, 2011

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

jdh2358 commented Sep 1, 2011

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

mdboom commented Nov 8, 2011

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 request Dec 31, 2011
allow fillstyle 'none' option
@efiring efiring merged commit 1afa742 into matplotlib:master Dec 31, 2011
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Nov 24, 2020
This is brittle, but matches the behavior in Line2D.

MarkerStyle objects have two coupled, but not fully redundant methods
for 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.  In
particular the markers that can not be filled (because the Paths they
are 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 onto
its MarkerStyle object instead of just extracting the path).

The logic for fillstyle on Markers came in via matplotlib#447/
213459e.

closes matplotlib#17849

Revises matplotlib#17543 / d86cc2b
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Nov 24, 2020
This is brittle, but matches the behavior in Line2D.

MarkerStyle objects have two coupled, but not fully redundant methods
for 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.  In
particular the markers that can not be filled (because the Paths they
are 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 onto
its MarkerStyle object instead of just extracting the path).

The logic for fillstyle on Markers came in via matplotlib#447/
213459e.

closes matplotlib#17849

Revises matplotlib#17543 / d86cc2b
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 21, 2021
This is brittle, but matches the behavior in Line2D.

MarkerStyle objects have two coupled, but not fully redundant methods
for 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.  In
particular the markers that can not be filled (because the Paths they
are 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 onto
its MarkerStyle object instead of just extracting the path).

The logic for fillstyle on Markers came in via matplotlib#447/
213459e.

closes matplotlib#17849

Revises matplotlib#17543 / d86cc2b
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 22, 2021
This is brittle, but matches the behavior in Line2D.

MarkerStyle objects have two coupled, but not fully redundant methods
for 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.  In
particular the markers that can not be filled (because the Paths they
are 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 onto
its MarkerStyle object instead of just extracting the path).

The logic for fillstyle on Markers came in via matplotlib#447/
213459e.

closes matplotlib#17849

Revises matplotlib#17543 / d86cc2b

Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 29, 2021
This is brittle, but matches the behavior in Line2D.

MarkerStyle objects have two coupled, but not fully redundant methods
for 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.  In
particular the markers that can not be filled (because the Paths they
are 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 onto
its MarkerStyle object instead of just extracting the path).

The logic for fillstyle on Markers came in via matplotlib#447/
213459e.

closes matplotlib#17849

Revises matplotlib#17543 / d86cc2b

Co-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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants