Vector axes but raster points for Matplotlib scatter plots

Viewed 4288

I have a Matplotlib scatter plot with 10,000+ points that I plan to insert as a figure in a LaTeX document for publication.

Plot Example

I would like the plot points to be raster graphics (e.g. PNG) because vector graphics with that many points often causes problems for PDF readers. I would like the ticks and axes labels to be vector graphics so I don't have to worry about resolution issues for the text and lines.

Is there a simple way to get matplotlib to make parts of the plot raster graphics while keeping the axes/ticks vector graphics?

My best guess so far is to do some sort of pre-render to PNG then imshow the resulting image with appropriate axes bounds before saving to PDF.

1 Answers
Related