| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Hi @Arikad0 - can you address the current check failures? (check out above the Linting, Mypy and Tests failures) Also, if this PR closes the issue you mentioned in the description, you can use one of the magic phrases such as "Closes #" so that GitHub understands to link the issue and PR. Thanks! |
Sorry, something went wrong.
|
As it stands, the implementation here is identical to that for the vertical lines, so we have import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.fill_between([0, 1], [0, 1], hatch="_")
plt.show()I believe the reason the tests fail is because we now have two vertical lines on top of each other for the "+" hatching. E.g here are the result and diff images for the failing legend test: @Arikad0 do you have thoughts on how to actually create the dashed pattern? |
Sorry, something went wrong.
|
I'm a bit lost on how to proceed on this issue. Do you have any idea that may help? Thanks in advance |
Sorry, something went wrong.
|
Gentle ping - any reviewers available to take a look? Thanks! |
Sorry, something went wrong.
|
I wondered if we could use the Shapes type of hatch with a very simple straight path for this and actually it seems to work well: Defining the class as class Dashes(Shapes):
size = 0.35
def __init__(self, hatch, density):
self.num_rows = (hatch.count('_')) * density
path = Path([[0, 0], [1, 0]], [Path.MOVETO, Path.LINETO])
self.shape_vertices = path.vertices
self.shape_codes = path.codes
super().__init__(hatch, density)and adapting the example from #27146 import matplotlib.pyplot as plt
import numpy as np
# Data
cols = 10
rows = 4
data = (
np.reshape(np.arange(0, cols, 1), (1, -1)) ** 2
+ np.reshape(np.arange(0, rows), (-1, 1))
+ np.random.random((rows, cols))*5
)
# Plot
fig, ax = plt.subplots()
x = range(data.shape[1])
ax.stackplot(
x, data,
hatch=["_", "__", "___", "____"]
)
ax.set_xlim(0, 9)
ax.set_ylim(0, 350)
plt.show()Possibly there are better ways. |
Sorry, something went wrong.
|
Is there any way to bypass the MatplotlibDeprecationWarning, in case of adding custom class (e.g. dashed). def _validate_hatch_pattern(hatch):
valid_hatch_patterns = set(r'_-+|/\xXoO.*') # Adding '_' Dashed patternAfter implementing above and menetioning it in hatch.pyi , still getting MatplotlibDeprecationWarning: hatch must consist of a string of "*+-./OX\ox|" or None, but found the following invalid values "_". Passing invalid values is deprecated since 3.4 and will become an error in 3.9. |
Sorry, something went wrong.
|
Did you search for that warning in the source code? |
Sorry, something went wrong.
Thanks, it is working after a restart. |
Sorry, something went wrong.
|
I am going to close this in favour of #28072. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Dashed Hatch added / #27170