With recent versions of matplotlib, you can set the "path.simplify" 
rcParam to True, which should reduce the data so that vertices that have 
no impact on the plot appearance (at the given dpi) are removed.

You can do either, in your script:

  from matplotlib import rcParam
  rcParam['path.simplify'] = True

or in your matplotlibrc file:

  path.simplify: True

Hope that helps.  The amount of reduction this produces is somewhat 
data-dependent.

Cheers,
Mike

Daniel Soto wrote:
> hello,
>
> i'm using matplotlib on os x and am having issues with plots of large  
> data sets.  i have some plots which contain about ~10000 points and  
> the pdf files generated bring preview.app and quicklook to their knees  
> when they open the pdf files.
>
> here is a small file that reproduces my issues.  at 1000 points it is  
> snappy and at 10000 it is a pig.
>
> is there a setting to downsample or otherwise compress?
>
> best,
> drs
>
>
>
> import matplotlib.pyplot
> import scipy
>
> x = scipy.rand(10000)
> matplotlib.pyplot.plot(x)
> matplotlib.pyplot.savefig('rand.pdf')
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to