You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While matplotlib currently provides a degree of hatch fill functionality with set_hatch, fine control of the angle and density of hatch lines isn't straightforward. The current functionality only directly allows the parallel hatch lines at horizontal, vertical, or 45 degree diagonal orientations, and the density of those lines is expressed implicitly by strings of repeating symbols (e.g. "/" for a sparse diagonal hatch, "///" for a more dense one, etc).
Hatch patterns are also currently tied to the shape they're filling, whereas an independent collection of lines would be more flexible for further graphical manipulation.
Proposed Solution
My suggestion is a distinct method for generating a hatch of parallel lines, based on a target shape, accepting numeric angle and density values. I'm imagining this functioning as something like another item in the matplotlib.patches family, invoked along the lines of
where bounding_polygon is e.g. a Polygon patch, angle is the orientation angle to which the hatch lines run parallel, and size is a gap between each hatch line along the axis perpendicular to the orientation angle.
The result would be a new patch object consisting of some number of line segments that effectively fill the original shape's interior area with hatching lines but which exists as its own independent patch.
The text was updated successfully, but these errors were encountered:
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Problem
While matplotlib currently provides a degree of hatch fill functionality with set_hatch, fine control of the angle and density of hatch lines isn't straightforward. The current functionality only directly allows the parallel hatch lines at horizontal, vertical, or 45 degree diagonal orientations, and the density of those lines is expressed implicitly by strings of repeating symbols (e.g. "/" for a sparse diagonal hatch, "///" for a more dense one, etc).
Hatch patterns are also currently tied to the shape they're filling, whereas an independent collection of lines would be more flexible for further graphical manipulation.
Proposed Solution
My suggestion is a distinct method for generating a hatch of parallel lines, based on a target shape, accepting numeric angle and density values. I'm imagining this functioning as something like another item in the matplotlib.patches family, invoked along the lines of
matplotlib.patches.Hatch(bounding_polygon, angle, size)
where bounding_polygon is e.g. a Polygon patch, angle is the orientation angle to which the hatch lines run parallel, and size is a gap between each hatch line along the axis perpendicular to the orientation angle.
The result would be a new patch object consisting of some number of line segments that effectively fill the original shape's interior area with hatching lines but which exists as its own independent patch.
The text was updated successfully, but these errors were encountered: