FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

configure hash density and size · Issue #7750 · matplotlib/matplotlib · GitHub

Repository navigation

configure hash density and size #7750

Closed as not planned
Closed as not planned

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

EDIT:
mpl 2.0.0:

mpl 1.5.3:

Activity

  1. added this to the milestone on Jan 5, 2017
  2. tacaswell commented on Jan 5, 2017

    Member

    att @Carreau As this is mostly with the inline backend someone from jupyter should be looped in.

  3. tacaswell commented on Jan 5, 2017

    Member

    Hatches being dpi independent is a feature of 2.0.

  4. godaygo commented on Jan 5, 2017

    Author

    @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. :)

  5. Carreau commented on Jan 6, 2017

    Contributor

    Thanks, I"ll have a look

  6. tacaswell commented on Jan 16, 2017

    Member

    ok, I can reproduce the issue locally. One possible solution is to use

    patt = [p*2 for p in ['-', '+', 'x', 'o', 'O', '.', '*', '\\', '/'] ]

    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.

  7. tacaswell commented on Jan 16, 2017

    Member

    attn @QuLogic where is the hatch density set?

  8. modified the milestones: , on Jan 16, 2017
  9. tacaswell commented on Jan 16, 2017

    Member

    Pushing this to 2.2 because it requires adding configuration knobs to tune the hash size and density.

  10. changed the title [-]figure_format = 'retina' behavior mpl 1.5.3 vs mpl 2.0.0.[/-] [+]configure hash density and size[/+] on Jan 16, 2017
  11. Carreau commented on Jan 16, 2017

    Contributor

    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 !

  12. QuLogic commented on Jan 20, 2017

    Member

    @tacaswell The density is applied in hatch.py from 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 uses backend_bases.py:get_hatch_path, but it doesn't pass a density either and uses the same default.

  13. github-actions commented on 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!

  14. oscargus commented on Apr 5, 2023

    Member

    Related to #20690

  15. github-actions commented on 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!

  16. added
    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.
    on May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Actiontopic: hatch

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL