Skip to content

Rasterized vs. unrasterized graphics #75

Closed
@lukelbd

Description

@lukelbd

This might have to do with #4 and the persistent extra 2 seconds @aaronspring observed.

By default matplotlib has an n_rasterized threshold at which point pcolor and pcolormesh plots become "rasterized" (i.e. translated into pixels) and embedded in the vector graphic. But ProPlot sets rasterized to False for all pcolor and pcolormesh plots:

https://github.com/lukelbd/proplot/blob/11a416a7ec14bdf9654abd2909c0ebb89cb69137/proplot/wrappers.py#L2982

This is because I found rasterized boxes embedded in vector graphics produced weird artifacts where the pixels can bleed out behind axes spines and other objects, and (I think) it's no longer infinitely scalable when saved as pdf or svg. But this also increases the file size and probably the render time for very hi-res graphics.

In a future version I'll explain the pitfalls of always-rasterized graphics, set the default to rasterized=True always, but permit specifying rasterized=False by the user (which currently gets overridden by cmap_changer).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions