Skip to content

configure hash density and size #7750

Closed as not planned
Closed as not planned
@godaygo

Description

@godaygo

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

mpl 1 5 3 default title

mpl 1 5 3 retina title

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:

mpl 2 default title

mpl 2 retina title

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 2 0 0

mpl 1.5.3:
mpl 1 5 3

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