[Matplotlib-users] embedding subset of fonts when saving to pdf

2011-05-27 Thread Simon Jesenko
Hi,

I have a problem with large file-sizes of plots saved to pdf, when using
rcParams['text.usetex']=True

Files are very large (~150kb for simple line plot with some mathematical 
latex expressions) as all fonts are fully embedded into pdf. When 
resulting pdf is postprocessed (e.g. as is 
http://zeppethefake.blogspot.com/2008/05/embedding-fonts-in-pdf-with-ghostscript.html),
 
so that only subset of fonts is embedded, file size is reduced 
drastically(e.g. from 150kb to 15kb).

Is there a way to enable embedding of subset of fonts in matplotlib?

I am using matplotlib version 0.99.3.

Did anyone else experience similar problems/found solution?

Thank you for info/assistance!
Simon

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] embedding subset of fonts when saving to pdf

2011-05-27 Thread Michael Droettboom
Have you tried setting the rcParams "pdf.fonttype" to 3?  That should 
subset the fonts.

Also, the Cairo backend supports font subsetting.

Mike

On 05/27/2011 07:00 AM, Simon Jesenko wrote:
> Hi,
>
> I have a problem with large file-sizes of plots saved to pdf, when using
> rcParams['text.usetex']=True
>
> Files are very large (~150kb for simple line plot with some mathematical
> latex expressions) as all fonts are fully embedded into pdf. When
> resulting pdf is postprocessed (e.g. as is
> http://zeppethefake.blogspot.com/2008/05/embedding-fonts-in-pdf-with-ghostscript.html),
> so that only subset of fonts is embedded, file size is reduced
> drastically(e.g. from 150kb to 15kb).
>
> Is there a way to enable embedding of subset of fonts in matplotlib?
>
> I am using matplotlib version 0.99.3.
>
> Did anyone else experience similar problems/found solution?
>
> Thank you for info/assistance!
> Simon
>
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] embedding subset of fonts when saving to pdf

2011-05-27 Thread Simon Jesenko
Setting 'pdf.fonttype'=3 had no effect, embedded fonts are of fonttype=1 
nonetheless. I guess that pdf.fonttype parameter is used only when 
matplotlib uses it's own engine to render latex, and not when 
text.usetex=true is used.

Cairo backend is not support when text.usetex=true (only Agg, pdf and ps 
according to documentation)

On 05/27/2011 03:53 PM, Michael Droettboom wrote:
> Have you tried setting the rcParams "pdf.fonttype" to 3?  That should
> subset the fonts.
>
> Also, the Cairo backend supports font subsetting.
>
> Mike
>
> On 05/27/2011 07:00 AM, Simon Jesenko wrote:
>> Hi,
>>
>> I have a problem with large file-sizes of plots saved to pdf, when using
>> rcParams['text.usetex']=True
>>
>> Files are very large (~150kb for simple line plot with some mathematical
>> latex expressions) as all fonts are fully embedded into pdf. When
>> resulting pdf is postprocessed (e.g. as is
>> http://zeppethefake.blogspot.com/2008/05/embedding-fonts-in-pdf-with-ghostscript.html),
>> so that only subset of fonts is embedded, file size is reduced
>> drastically(e.g. from 150kb to 15kb).
>>
>> Is there a way to enable embedding of subset of fonts in matplotlib?
>>
>> I am using matplotlib version 0.99.3.
>>
>> Did anyone else experience similar problems/found solution?
>>
>> Thank you for info/assistance!
>> Simon
>>
>> --
>> vRanger cuts backup time in half-while increasing security.
>> With the market-leading solution for virtual backup and recovery,
>> you get blazing-fast, flexible, and affordable data protection.
>> Download your free trial now.
>> http://p.sf.net/sfu/quest-d2dcopy1
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] embedding subset of fonts when saving to pdf

2011-05-27 Thread Michael Droettboom
Ah, yes.  That is all true.  I'm not sure what options there may be in 
that case.

Mike

On 05/27/2011 10:56 AM, Simon Jesenko wrote:
> Setting 'pdf.fonttype'=3 had no effect, embedded fonts are of fonttype=1
> nonetheless. I guess that pdf.fonttype parameter is used only when
> matplotlib uses it's own engine to render latex, and not when
> text.usetex=true is used.
>
> Cairo backend is not support when text.usetex=true (only Agg, pdf and ps
> according to documentation)
>
> On 05/27/2011 03:53 PM, Michael Droettboom wrote:
>> Have you tried setting the rcParams "pdf.fonttype" to 3?  That should
>> subset the fonts.
>>
>> Also, the Cairo backend supports font subsetting.
>>
>> Mike
>>
>> On 05/27/2011 07:00 AM, Simon Jesenko wrote:
>>> Hi,
>>>
>>> I have a problem with large file-sizes of plots saved to pdf, when using
>>> rcParams['text.usetex']=True
>>>
>>> Files are very large (~150kb for simple line plot with some mathematical
>>> latex expressions) as all fonts are fully embedded into pdf. When
>>> resulting pdf is postprocessed (e.g. as is
>>> http://zeppethefake.blogspot.com/2008/05/embedding-fonts-in-pdf-with-ghostscript.html),
>>> so that only subset of fonts is embedded, file size is reduced
>>> drastically(e.g. from 150kb to 15kb).
>>>
>>> Is there a way to enable embedding of subset of fonts in matplotlib?
>>>
>>> I am using matplotlib version 0.99.3.
>>>
>>> Did anyone else experience similar problems/found solution?
>>>
>>> Thank you for info/assistance!
>>> Simon
>>>
>>> --
>>> vRanger cuts backup time in half-while increasing security.
>>> With the market-leading solution for virtual backup and recovery,
>>> you get blazing-fast, flexible, and affordable data protection.
>>> Download your free trial now.
>>> http://p.sf.net/sfu/quest-d2dcopy1
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> --
>> vRanger cuts backup time in half-while increasing security.
>> With the market-leading solution for virtual backup and recovery,
>> you get blazing-fast, flexible, and affordable data protection.
>> Download your free trial now.
>> http://p.sf.net/sfu/quest-d2dcopy1
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mathbb and eps export

2011-05-27 Thread Oscar Benjamin
Thanks, Mike.

I've been away from the Windows machine for a couple of days. I did
ps.useafm set and your suggestion solved the problem.

Is there a reason not to use TrueType in all of my figures (since it
wasn't enabled by default)?

Thanks,
Oscar.
On Tue, May 24, 2011 at 11:06:10AM -0400, Michael Droettboom wrote:
> You probably have "ps.useafm" set, right?  Unfortunately, the stock
> Postscript AFM fonts do not have a blackboard style.  Setting
> ps.useafm to False will use Truetype fonts, and it should work.
> 
> Cheers,
> Mike
> 
> On 05/24/2011 10:50 AM, Oscar Benjamin wrote:
> >Hello,
> >
> >I'm getting an error using latex mathbb and exporting to eps. The
> >following script demonstrates:
> >
> >from pylab import figure, show
> >fig = figure()
> >ax = fig.add_subplot(1, 1, 1)
> >ax.set_title(r'$\mathbb{R}$')
> >fig.savefig('mathbb.eps')
> >
> >On Windows the above gives me a long traceback ending with:
> >IOError: [Errno 2] No such file or directory: 
> >'q:\\tools\\Python26\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\afm\\bb.afm'
> >
> >It works fine if using \mathbf instead of \mathbb or when saving
> >to pdf etc.
> >
> >I thought I had this working on Linux, does anyone know if this is
> >a problem to do with my installation, or maybe an unsupported
> >feature.
> >
> >Thanks,
> >Oscar.
> >
> >
> >--
> >vRanger cuts backup time in half-while increasing security.
> >With the market-leading solution for virtual backup and recovery,
> >you get blazing-fast, flexible, and affordable data protection.
> >Download your free trial now.
> >http://p.sf.net/sfu/quest-d2dcopy1
> >
> >
> >___
> >Matplotlib-users mailing list
> >Matplotlib-users@lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Space Telescope Science Institute
> Baltimore, Maryland, USA
> 

> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery, 
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now. 
> http://p.sf.net/sfu/quest-d2dcopy1

> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mathbb and eps export

2011-05-27 Thread Michael Droettboom
The main difference is file size.  When ps.useafm is True, the fonts 
don't have to be embedded because it uses fonts that are required to be 
available with every Postscript interpreter.  When it is False, the 
fonts have to be included as part of the file, resulting in larger file 
sizes.

Mike

On 05/27/2011 11:10 AM, Oscar Benjamin wrote:
> Thanks, Mike.
>
> I've been away from the Windows machine for a couple of days. I did
> ps.useafm set and your suggestion solved the problem.
>
> Is there a reason not to use TrueType in all of my figures (since it
> wasn't enabled by default)?
>
> Thanks,
> Oscar.
> On Tue, May 24, 2011 at 11:06:10AM -0400, Michael Droettboom wrote:
>> You probably have "ps.useafm" set, right?  Unfortunately, the stock
>> Postscript AFM fonts do not have a blackboard style.  Setting
>> ps.useafm to False will use Truetype fonts, and it should work.
>>
>> Cheers,
>> Mike
>>
>> On 05/24/2011 10:50 AM, Oscar Benjamin wrote:
>>> Hello,
>>>
>>> I'm getting an error using latex mathbb and exporting to eps. The
>>> following script demonstrates:
>>>
>> >from pylab import figure, show
>>> fig = figure()
>>> ax = fig.add_subplot(1, 1, 1)
>>> ax.set_title(r'$\mathbb{R}$')
>>> fig.savefig('mathbb.eps')
>>>
>>> On Windows the above gives me a long traceback ending with:
>>> IOError: [Errno 2] No such file or directory: 
>>> 'q:\\tools\\Python26\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\afm\\bb.afm'
>>>
>>> It works fine if using \mathbf instead of \mathbb or when saving
>>> to pdf etc.
>>>
>>> I thought I had this working on Linux, does anyone know if this is
>>> a problem to do with my installation, or maybe an unsupported
>>> feature.
>>>
>>> Thanks,
>>> Oscar.
>>>
>>>
>>> --
>>> vRanger cuts backup time in half-while increasing security.
>>> With the market-leading solution for virtual backup and recovery,
>>> you get blazing-fast, flexible, and affordable data protection.
>>> Download your free trial now.
>>> http://p.sf.net/sfu/quest-d2dcopy1
>>>
>>>
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>> -- 
>> Michael Droettboom
>> Science Software Branch
>> Space Telescope Science Institute
>> Baltimore, Maryland, USA
>>
>> --
>> vRanger cuts backup time in half-while increasing security.
>> With the market-leading solution for virtual backup and recovery,
>> you get blazing-fast, flexible, and affordable data protection.
>> Download your free trial now.
>> http://p.sf.net/sfu/quest-d2dcopy1
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] making a bar chart with time on xaxis

2011-05-27 Thread Aman Thakral
Hi Amy,

Use the vlines() function.  Its what I have used in the past.

Cheers,
Aman

On Fri, May 27, 2011 at 12:28 PM, Amy Zhang wrote:

> Hello,
>
> I've created the following chart using matplotlib.pyplot.plot(). However, I
> would like to see the data points as bars from the bottom of the graph up to
> the points in order to more easily show the lack of data at certain dates.
> Is there a way to do this using plot()? If not, how do I go about making a
> bar chart using time as my xaxis? And how would I format the xticks so that
> only months are shown, as I have it now?
>
> Thank you,
> Amy
>
>
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Removing Markers from Figure

2011-05-27 Thread Patrick Marsh
Greetings,

I'm needing to create two plots, one is to serve as an overlay on the
other.  The overlay contains a set of markers to identify points in
the underlaid probability field.  I'm doing this in a loop with a map
background, so to prevent redrawing the map every time, I want to
remove the markers after saving the plot (so I can then reuse the
background again).  I know how to remove contours, but cannot figure
out how to remove points.  Here is a link to a sample script that
illustrates the problem.

https://gist.github.com/072c8612f313e8ea2355

Ideally, I would expect each plot to have only a single point, but the
old points aren't being removed and are displayed on subsequent
images.  What am I doing wrong?


Patrick
---
Patrick Marsh
Ph.D. Student / Liaison to the HWT
School of Meteorology / University of Oklahoma
Cooperative Institute for Mesoscale Meteorological Studies
National Severe Storms Laboratory
http://www.patricktmarsh.com

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] making a bar chart with time on xaxis

2011-05-27 Thread Alan G Isaac
On 5/27/2011 12:28 PM, Amy Zhang wrote:
> I've created the following chart using matplotlib.pyplot.plot(). However, I 
> would like to see the data points as bars from the bottom of the graph up to 
> the points

Matplotlib supports stem plots:
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.stem
(Oddly, the only example of this seems to be a link to a Matlab plot...?
But anyway, Matplotlib works great for this.)
But if you really want, you can use vlines:
http://matplotlib.sourceforge.net/examples/pylab_examples/vline_demo.html

hth,
Alan Isaac


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Removing Markers from Figure

2011-05-27 Thread Eric Firing
On 05/27/2011 07:53 AM, Patrick Marsh wrote:
> Greetings,
>
> I'm needing to create two plots, one is to serve as an overlay on the
> other.  The overlay contains a set of markers to identify points in
> the underlaid probability field.  I'm doing this in a loop with a map
> background, so to prevent redrawing the map every time, I want to
> remove the markers after saving the plot (so I can then reuse the
> background again).  I know how to remove contours, but cannot figure
> out how to remove points.  Here is a link to a sample script that
> illustrates the problem.
>
> https://gist.github.com/072c8612f313e8ea2355
>
> Ideally, I would expect each plot to have only a single point, but the
> old points aren't being removed and are displayed on subsequent
> images.  What am I doing wrong?

Illustration with ipython -pylab:

In [1]: xx = plot(1.3, 2.4, 'ro')

In [2]: xx[0].remove()

In [3]: draw()

Note that plot() returns a list of Line2D objects, each of which has a 
remove() method.

Eric


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Not able to access CSV file:

2011-05-27 Thread Karthikraja Velmurugan
Hello Daniel,

The code you have given is simple and works fab. Thank you very much. But I
wasn't able to find an example which accesses the columns of a CSV files
when I import data through "datafile="filename.csv"" option. It will be
great if you could help with accessing individual columns. What excatly I am
looking for is to access individual coulmns (of the same CSV file), do
calculations using the two coumns and plot them into seperate subplots of
the same graph.
I modified the script a lil bit. Please find it below:

*import matplotlib.pyplot as plt
import pylab
datafile1 = 'ch1_s1_lrr.csv'
datafile2 = 'ch1_s1_baf.csv'*
*a1 = pylab.loadtxt(datafile1, comments='#', delimiter=';')
b1 = pylab.loadtxt(datafile2, comments='#', delimiter=';')*
*v1 = [0,98760,0,1]
v2 = [0,98760,-2,2]*
*plt.figure(1)*
*plt.subplot(4,1,1)
print 'loading', datafile1
plt.axis(v2)
plt.plot(a1, 'r.')*
*plt.subplot(4,1,2)
print 'loading', datafile2
plt.axis(v1)
plt.plot(b1, 'b.')*
*plt.show()*

Thank you very much in advance for your time and suggestions.

Karthik
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] making a bar chart with time on xaxis

2011-05-27 Thread Amy Zhang
Thank you all! vlines was exactly what I needed.
Amy

On Fri, May 27, 2011 at 3:03 PM, Alan G Isaac  wrote:

> On 5/27/2011 12:28 PM, Amy Zhang wrote:
> > I've created the following chart using matplotlib.pyplot.plot(). However,
> I would like to see the data points as bars from the bottom of the graph up
> to the points
>
> Matplotlib supports stem plots:
>
> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.stem
> (Oddly, the only example of this seems to be a link to a Matlab plot...?
> But anyway, Matplotlib works great for this.)
> But if you really want, you can use vlines:
> http://matplotlib.sourceforge.net/examples/pylab_examples/vline_demo.html
>
> hth,
> Alan Isaac
>
>
>
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Removing Markers from Figure

2011-05-27 Thread Patrick Marsh
Thanks, Eric!

I had tried

pt = plot(...)

for p in pt:
  p.remove()

and that did not do the trick.  However, doing it the way you
suggested worked like a charm.  Thanks!


Patrick
---
Patrick Marsh
Ph.D. Student / Liaison to the HWT
School of Meteorology / University of Oklahoma
Cooperative Institute for Mesoscale Meteorological Studies
National Severe Storms Laboratory
http://www.patricktmarsh.com




On Fri, May 27, 2011 at 2:57 PM, Eric Firing  wrote:
> On 05/27/2011 07:53 AM, Patrick Marsh wrote:
>> Greetings,
>>
>> I'm needing to create two plots, one is to serve as an overlay on the
>> other.  The overlay contains a set of markers to identify points in
>> the underlaid probability field.  I'm doing this in a loop with a map
>> background, so to prevent redrawing the map every time, I want to
>> remove the markers after saving the plot (so I can then reuse the
>> background again).  I know how to remove contours, but cannot figure
>> out how to remove points.  Here is a link to a sample script that
>> illustrates the problem.
>>
>> https://gist.github.com/072c8612f313e8ea2355
>>
>> Ideally, I would expect each plot to have only a single point, but the
>> old points aren't being removed and are displayed on subsequent
>> images.  What am I doing wrong?
>
> Illustration with ipython -pylab:
>
> In [1]: xx = plot(1.3, 2.4, 'ro')
>
> In [2]: xx[0].remove()
>
> In [3]: draw()
>
> Note that plot() returns a list of Line2D objects, each of which has a
> remove() method.
>
> Eric
>
>
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users