| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| gc, paths[0], combined_transform.frozen(), | ||
| mpath.Path(offsets), offset_trf, tuple(facecolors[0])) | ||
| else: | ||
| if self._gapcolor is not None: |
There was a problem hiding this comment.
Note that do_single_path_optimization is only True if all the lines are solid
matplotlib/lib/matplotlib/collections.py
Line 381 in fc5d316
Sorry, something went wrong.
|
@rcomer for a new feature like this, its nice to either include example code in the description, or in documentation of the feature. I'm not quite following the API from the test images and the tests (though I only tried for a minute or so). |
Sorry, something went wrong.
|
Thanks @jklymak, I have updated the OP. |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
This seems fine to me, despite never using v/hlines ;-)
Sorry, something went wrong.
There was a problem hiding this comment.
Wording nits but I'm happy w/this. Thanks! (Also sorry for dragging this into the color validation arguments)
Sorry, something went wrong.
| There can be overlaps between those two, which may result in | ||
| artifacts when using transparency. | ||
|
|
||
| This functionality is experimental and may change. |
There was a problem hiding this comment.
smallest little nit but I'd put only this very last sentence in the note and have everything else as just part of the docstring.
Sorry, something went wrong.
There was a problem hiding this comment.
The note here was lifted straight from the equivalent in Line2D.
https://matplotlib.org/stable/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D.set_gapcolor
Sorry, something went wrong.
There was a problem hiding this comment.
I think it should be changed there too but out of scope so I can put in that PR
Sorry, something went wrong.
There was a problem hiding this comment.
From what I remember of #23208, this went through a few iterations: started out with a warning about overlaps that don't look great with transparency. Then the warning was downgraded to a note, and the "experimental" bit added later. Given the amount of previous bikeshedding on this, I would be uncomfortable about changing it without a bit more discussion. That could happen in a follow-up PR, as you say.
Sorry, something went wrong.
| Used when gapcolor is set. Return the path and inverse pattern for | ||
| non solid lines, so we can use these to fill the gaps. For solid lines | ||
| we insert a path of nans so that no inverse line is drawn in that case. |
There was a problem hiding this comment.
| Used when gapcolor is set. Return the path and inverse pattern for | |
| non solid lines, so we can use these to fill the gaps. For solid lines | |
| we insert a path of nans so that no inverse line is drawn in that case. | |
| Returns the path and pattern for the gaps in the non-solid lines. | |
| This path and pattern is the inverse of the path and pattern used to construct the non-solid lines. For solid lines, we set the inverse path to nans to prevent drawing an inverse line. |
Wordsmithing, take or leave
Sorry, something went wrong.
There was a problem hiding this comment.
Taken!
Sorry, something went wrong.
| non solid lines, so we can use these to fill the gaps. For solid lines | ||
| we insert a path of nans so that no inverse line is drawn in that case. | ||
| """ | ||
| pairs = [ |
There was a problem hiding this comment.
Pairs is path_pattern?
Sorry, something went wrong.
There was a problem hiding this comment.
Do you mean I should change the variable name? Happy to do so if so.
Sorry, something went wrong.
There was a problem hiding this comment.
Was confirming that I understood what the code was doing but if I'm right than yes please
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
|
Does anyone have an opinion on this Codecov failure? It seems unlikely to me that such a simple method could get broken. |
Sorry, something went wrong.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Closes #24796.
Following #23208, which implemented the gapcolor property for Line2D, this PR implements gapcolor for LineCollection. So we can set a colour (or list of colours) to fill the gaps in dashed lines and make a striped effect. For example
I marked this functionality as "experimental" to be consistent with Line2D.
My current implementation works, but I'm pretty unsure about the way I've structured it: it doesn't seem great to have the LineCollection-specific handling within Collection. The only way I can see to avoid that is to define LineCollection.draw, but that would mean duplicating some code, which also wouldn't seem great.
For reference, the test images look like this:
gapcolor='orange'

gapcolor=['r', 'k']

I'm happy to squash the commits down once we're happy with the implementation, but I suspect there will be plenty of changes before that...
PR Checklist
Documentation and Tests
Release Notes