Skip to content

Commit

Permalink
Removed _set_hatch_linewidth and pulled back unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Impaler343 committed May 8, 2024
1 parent 3c417ab commit e949945
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
12 changes: 1 addition & 11 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,19 +1007,9 @@ def get_hatch_linewidth(self):
return self._hatch_linewidth

def set_hatch_linewidth(self, hatch_linewidth):
"""Set the hatch linewidth."""
"""Set the hatch linewidth - not supported on all backends."""
self._hatch_linewidth = hatch_linewidth

def _set_hatch_linewidth(self, hatch_linewidth):
if hasattr(self, "set_hatch_linewidth"):
self.set_hatch_linewidth(hatch_linewidth)
else:
_api.warn_deprecated(
"3.8", message="The current backend does not define "
"GraphicsContextRenderer.set_hatch_linewidth; support for such "
"backends is deprecated since %(since)s and will be removed "
"%(removal)s.")

def get_sketch_params(self):
"""
Return the sketch parameters for the artist.
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/backend_bases.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class GraphicsContextBase:
def set_hatch_color(self, hatch_color: ColorType) -> None: ...
def get_hatch_linewidth(self) -> float: ...
def set_hatch_linewidth(self, hatch_linewidth: float) -> None: ...
def _set_hatch_linewidth(self, hatch_linewidth: float) -> None: ...
def get_sketch_params(self) -> tuple[float, float, float] | None: ...
def set_sketch_params(
self,
Expand Down
18 changes: 9 additions & 9 deletions lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2575,16 +2575,16 @@ def clip_cmd(self, cliprect, clippath):

commands = (
# must come first since may pop
(("_cliprect", "_clippath"), clip_cmd),
(("_alpha", "_forced_alpha", "_effective_alphas"), alpha_cmd),
(("_capstyle",), capstyle_cmd),
(("_fillcolor",), fillcolor_cmd),
(("_joinstyle",), joinstyle_cmd),
(("_linewidth",), linewidth_cmd),
(("_dashes",), dash_cmd),
(("_rgb",), rgb_cmd),
(('_cliprect', '_clippath'), clip_cmd),
(('_alpha', '_forced_alpha', '_effective_alphas'), alpha_cmd),
(('_capstyle',), capstyle_cmd),
(('_fillcolor',), fillcolor_cmd),
(('_joinstyle',), joinstyle_cmd),
(('_linewidth',), linewidth_cmd),
(('_dashes',), dash_cmd),
(('_rgb',), rgb_cmd),
# must come after fillcolor and rgb
(("_hatch", "_hatch_color", "_hatch_linewidth"), hatch_cmd),
(('_hatch', '_hatch_color', '_hatch_linewidth'), hatch_cmd),
)

def delta(self, other):
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def draw(self, renderer):
if self._hatch:
gc.set_hatch(self._hatch)
gc.set_hatch_color(self._hatch_color)
gc._set_hatch_linewidth(self._hatch_linewidth)
gc.set_hatch_linewidth(self._hatch_linewidth)

if self.get_sketch_params() is not None:
gc.set_sketch_params(*self.get_sketch_params())
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def _draw_paths_with_artist_properties(
if self._hatch:
gc.set_hatch(self._hatch)
gc.set_hatch_color(self._hatch_color)
gc._set_hatch_linewidth(self._hatch_linewidth)
gc.set_hatch_linewidth(self._hatch_linewidth)

if self.get_sketch_params() is not None:
gc.set_sketch_params(*self.get_sketch_params())
Expand Down

0 comments on commit e949945

Please sign in to comment.