Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsharp text in the Inline-backend. #4102

Closed
Tillsten opened this issue Feb 15, 2015 · 11 comments
Closed

Unsharp text in the Inline-backend. #4102

Tillsten opened this issue Feb 15, 2015 · 11 comments
Milestone

Comments

@Tillsten
Copy link
Contributor

Maybe this is a little bit subjective, but even after playing around with dpi, fonts and
figure size, i still think that the text in plots generated by mpl looks not as sharp as it could be.
Please note i don't think my installation is to fault, e.g. the text in the examples at
https://github.com/jbmouret/matplotlib_for_papers also looks not to good. In day
to day usage it is quite visible when working in the ipython notebook, even after adjusting
the savefig.dpi.

If i am the only one thinking this way, please close the issues, but i think there could be something
wrong, either in freetype itself or the binding to it.

@efiring
Copy link
Member

efiring commented Feb 15, 2015

It would be most helpful if you could include a minimal script and the resulting .png file illustrating this.

@tacaswell tacaswell added this to the v1.5.x milestone Feb 15, 2015
@mdboom
Copy link
Member

mdboom commented Feb 17, 2015

And a screenshot of some text that you think looks better would be helpful as well.

Note one thing that matplotlib does not do is subpixel antialiasing (called ClearType by Microsoft), since such images would not be portable to other displays. This does give the appearance of slightly less antialiasing than you might see elsewhere on your system.

@Tillsten
Copy link
Contributor Author

There more i play around with it the more i am sure that this is somehow ipython fault. Have look at

http://nbviewer.ipython.org/urls/gist.github.com/Tillsten/25e722abe97ad19e30f6/raw/f80604d99a1d1a888a238dd49c75eae197e5d1eb/mpl_inline

Both images are made by excatly the same code, only the backend differs. The top one is made by using %matplotlib qt (other backends have the same result.). The bottom one is done with %matplotlib inline. I think i have directly set every setting ipython changes. Both figures have the same pixel size.

@Tillsten
Copy link
Contributor Author

Hmm, ok it seems that the inline backend changes the font-size by default. I am not really happy about all the inline-backend related changes to the rcParams in ipython. This properly explains my impression: a 10-pt TTF-font looks quite bad if upscaled. So is mostly a ipython issue, please go ahead and close the issuse.

@tacaswell
Copy link
Member

You should also have a look at the nbagg backend.

@mdboom
Copy link
Member

mdboom commented Feb 17, 2015

Eventually we should probably figure out the CSS magic to have those images display at native resolution (i.e. "Retina mode"), too.

@Tillsten
Copy link
Contributor Author

nbagg only works locally, and i use for exploratory work. But one main advantage of notebook is easy sharing, which only works with inline figures. Tbh I think ipyton should offer an inline backend with no changes to rcParams and document the changes for default-inline backend better.

@tacaswell
Copy link
Member

nbagg should save down to png for sharing right?

@Tillsten
Copy link
Contributor Author

At least in the last version, one have to handle all the figures and close them
if necessery. I never tried to save a notebook with open figures as html.

Changes done by inline-defaulst:

    'figure.facecolor': (1,1,1,0),
    'figure.edgecolor': (1,1,1,0),
    'axes.facecolor': (1,1,1,0),
    'font.size': 10,
    'savefig.dpi': 72, 
    'figure.subplot.bottom' : .125

Also it uses

    bbox_inches = 'tight'

@Tillsten Tillsten changed the title Unsharp text in pixel-based backends Unsharp text in the Inline-backend. Feb 17, 2015
@Tillsten
Copy link
Contributor Author

I renamed the issue for better discoverability.

@Tillsten
Copy link
Contributor Author

Is there any place in the FAQ for it? E.g. "Why does my plot looks different than in the ipython-notebook?".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants