I guess you want this.
http://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.filled.html#numpy.ma.filled
-JJ
On Sat, Apr 11, 2009 at 3:36 PM, antonv <vasilescu_anton@...> wrote:
>
> Hi all,
>
> Another noob question here. I have a large masked array that I am plotting
> with "contourf" and because of the masked array i am getting jagged edges.
> If i could replace the masked data with a value that I supply then it will
> interpolate and give me the nice feathered edges that I need.
>
> Now my question is, what is the fastest way to add the supplied data to the
> masked areas? The only way I can think is to just iterate through the whole
> array and set the value of the masked areas to the value I want but I guess
> there should be other faster ways to do that.
>
> Any help is greatly appreciated!
>
> Thanks,
> Anton
> --
> View this message in context: http://www.nabble.com/convert-a-masked-array-to-a-non-masked-one--tp23004653p23004653.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

You can change the position of the subplot using "change_geometry"
method, although it does not accept a sting argument.
s1.change_geometry(2,1,1) # instead of "211"
-JJ
On Sat, Apr 11, 2009 at 4:59 PM, TP <paratribulations@...> wrote:
> Hi everybody,
>
> I would like to update a subplot position automatically. Try this example:
>
> ##################
> from pylab import *
> f = figure()
> s1 = f.add_subplot( '111' )
> s1.plot( [5,7], [6,9], 'r' )
> s2 = f.add_subplot( '212' )
> s2.plot( [5,7], [4,9], 'b' )
> show()
> ##################
>
> The problem is that the first subplot does not update its position when
> I add a second subplot with "position string" '212'. I would like the
> first subplot to take the position corresponding to a "position string"
> '211'.
>
> I have not found any means to do this. The figure has some methods
> "subplots_adjust" and "subplotpars", but it seems that I am compelled to
> set the precise coordinates of the subplots, and so cannot do the
> positioning automatically with a "position string". Am I right? What is
> the best way to deal with this kind of problem?
>
> Thanks a lot
>
> Julien
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

Hi everybody,
I would like to update a subplot position automatically. Try this example:
##################
from pylab import *
f = figure()
s1 = f.add_subplot( '111' )
s1.plot( [5,7], [6,9], 'r' )
s2 = f.add_subplot( '212' )
s2.plot( [5,7], [4,9], 'b' )
show()
##################
The problem is that the first subplot does not update its position when
I add a second subplot with "position string" '212'. I would like the
first subplot to take the position corresponding to a "position string"
'211'.
I have not found any means to do this. The figure has some methods
"subplots_adjust" and "subplotpars", but it seems that I am compelled to
set the precise coordinates of the subplots, and so cannot do the
positioning automatically with a "position string". Am I right? What is
the best way to deal with this kind of problem?
Thanks a lot
Julien

Hi all,
Another noob question here. I have a large masked array that I am plotting
with "contourf" and because of the masked array i am getting jagged edges.
If i could replace the masked data with a value that I supply then it will
interpolate and give me the nice feathered edges that I need.
Now my question is, what is the fastest way to add the supplied data to the
masked areas? The only way I can think is to just iterate through the whole
array and set the value of the masked areas to the value I want but I guess
there should be other faster ways to do that.
Any help is greatly appreciated!
Thanks,
Anton
--
View this message in context: http://www.nabble.com/convert-a-masked-array-to-a-non-masked-one--tp23004653p23004653.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Hi all,I want to use contourf function in matplotlib to plot 2D free energy
histogram for my research. I have 2 plots and want them have the same
colorbar scale so that I could compare the minima or maxima. I've been
looking at colorbar doc but i can not find a solution. I always gets 2
different colorbar scale.
Thanks for your reply and have a good day.
Regards
HNN

Ciarán Mooney wrote:
> Hi,
>
> I have an ASCII data set, which includes null data points. eg
>
> 1 x1 y1 z1
> 2 x2 y2 z2
> 3 x3 y3 z3
> 4 y3 z3
> 5 y4 z4
> 6 y5
>
> I am using ipython with pylab enabled, and the load("/xxx/xxx")
> function. However it chokes on the blank, "null", values. How can I
> get this data set into matplotlib?
I assume the file is using fixed-length fields. I don't know of any
ready-made tool for reading files with non-delimited fields, with or
without gaps, so you probably have to write your own to fit your
particular file. The general approach would be to read a line in as a
character string, use slices to isolate the fields, try to convert each
to a number, and if it fails put in a flag value. These numbers can go
in a list, and as you go through the lines you accumulate the lists in a
list. Then you can use numpy.ma.masked_equal(your_list_of_lists,
your_flag_value) to create a 2-D masked array suitable for use by mpl.
Eric
>
> Regards,
>
> Ciarán
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users