Repository navigation
Closed as not planned
Labels
status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Actiontopic: hatch
Milestone
Description
I've a laptop with HiDPI display, so I use c.InlineBackend.figure_format = 'retina' in IPython to prevent blurring in browser . I found some differences between mpl 1.5.3 and 2.0.0. I've tried to summarize them:
- In both versions, blur disappears when I set up
figure_format = 'retina'.
In mpl 1.5.3 'retina' also affects the hatches appearance (and they look nicer):
Here you can't see the blur, but it actually is, without setting up 'retina' or 'png2x'.
In mpl 2.0.0 'retina' only affects blur effect:
Also you can see that actual sizes differ between versions, I use 'Save image as' to get pictures. It's nice that visual size in 2.0.0 in Jupyter notebook holds the same, but hatches looks ugly:) Is it desirable behavior in 2.0.0?
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.patches as patches
fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal')
patt = ['-', '+', 'x', 'o', 'O', '.', '*', '\\', '/']
pol = lambda x, i: patches.RegularPolygon((i/(len(patt)-1), 0.5),
50, 0.05, fill=False, hatch=x)
for i, pat in enumerate(patt):
ax.add_patch(pol(pat, i))
ax.set_title('{} - retina\n size: ({}, {})'.format(mpl.__version__, fig.get_size_inches()[0],
fig.get_size_inches()[1]))
plt.show()I use:
Python 3.6
IPython 5.1.0
jupyter-notebook 4.3.1
Firefox 50.1.0
Windows 10
Metadata
Metadata
Assignees
Labels
status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Actiontopic: hatch






Activity
tacaswell commentedon Jan 5, 2017
att @Carreau As this is mostly with the inline backend someone from jupyter should be looped in.
tacaswell commentedon Jan 5, 2017
Hatches being dpi independent is a feature of 2.0.
godaygo commentedon Jan 5, 2017
@tacaswell Thank you let it be dpi independent.:) But the sizes really differ, I add print-screens in the same scale to my question, and OS is Windows. :)
Carreau commentedon Jan 6, 2017
Thanks, I"ll have a look
tacaswell commentedon Jan 16, 2017
ok, I can reproduce the issue locally. One possible solution is to use
to increase the density of the hatch.
The default density looks like it has gone down (but should now be consistent across backends and dpi, see #7421 and http://matplotlib.org/2.0.0rc2/users/dflt_style_changes.html#hatching).
A feature that we probably need to add is an rcParam to change the default density.
tacaswell commentedon Jan 16, 2017
attn @QuLogic where is the hatch density set?
tacaswell commentedon Jan 16, 2017
Pushing this to 2.2 because it requires adding configuration knobs to tune the hash size and density.
[-]figure_format = 'retina' behavior mpl 1.5.3 vs mpl 2.0.0.[/-][+]configure hash density and size[/+]Carreau commentedon Jan 16, 2017
Thanks @tacaswell, it's a good decision. I know it's tough to push things to later, but happy to see MPL 2.0 to be that close !
QuLogic commentedon Jan 20, 2017
@tacaswell The density is applied in
hatch.pyfrom some default somewhere and a count of the number of specifiers used.There are a lot of functions/methods that set a default value, but ultimately, the density is probably set from
path.py:Path.hatch. This static method is directly called by the PDF and PS backends without a density, so it uses its default. The Agg backend usesbackend_bases.py:get_hatch_path, but it doesn't pass a density either and uses the same default.github-actions commentedon Apr 5, 2023
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!
oscargus commentedon Apr 5, 2023
Related to #20690
github-actions commentedon Apr 8, 2024
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!