Re: [Matplotlib-users] contourf map with values

2015-03-01 Thread Benjamin Root
Not with contourf(), no. But, you can always add many Text objects after plotting the contourf() (just loop over the dimensions of your array at some stride and add Text objects at the appropriate coordinates). In fact, there might even be a feature coming up soon that would make this sort of task

Re: [Matplotlib-users] contourf() for "proper plotting purpose"

2013-05-22 Thread Nicolas Rougier
You can use the 'origin' keyword: pl.controuf(Matrix, origin='lower') or pl.controuf(Matrix, origin='upper') Nicolas On May 23, 2013, at 7:27 AM, Bakhtiyor Zokhidov wrote: > Hi, > > I have following code: > > import numpy as np > import pylab as pl > > Matrix(10,10) = > np.array([[ 4.

Re: [Matplotlib-users] contourf with rgba colours

2012-01-02 Thread Logi Ragnarsson
Eric Firing wrote: > > On Wed, Dec 28, 2011 at 1:11 AM, Jeff Whitaker wrote: >> >> On 12/27/11 12:07 PM, Logi Ragnarsson wrote: >> >>> Is it supposed to be possible to do a filled contour plot with alpha levels >>> in the colour map? I'm plotting weather data on top of maps and would very >>> mu

Re: [Matplotlib-users] contourf with rgba colours

2012-01-01 Thread Eric Firing
On 12/30/2011 01:57 PM, Paul Ivanov wrote: > Eric Firing, on 2011-12-27 15:31, wrote: >> It looks like this is something I can fix by modifying ListedColormap. >> It is discarding the alpha values, and I don't think there is any reason >> it needs to do so. > > One of my first attempts at a contri

Re: [Matplotlib-users] contourf with rgba colours

2011-12-30 Thread Paul Ivanov
Eric Firing, on 2011-12-27 15:31, wrote: > It looks like this is something I can fix by modifying ListedColormap. > It is discarding the alpha values, and I don't think there is any reason > it needs to do so. One of my first attempts at a contribution to matplotlib three years ago was related

Re: [Matplotlib-users] contourf with rgba colours

2011-12-27 Thread Eric Firing
On 12/27/2011 03:11 PM, Jeff Whitaker wrote: > On 12/27/11 12:07 PM, Logi Ragnarsson wrote: >> Hello, >> >> Is it supposed to be possible to do a filled contour plot with alpha >> levels in the colour map? I'm plotting weather data on top of maps and >> would very much like to plot low levels of wi

Re: [Matplotlib-users] contourf with rgba colours

2011-12-27 Thread Jeff Whitaker
On 12/27/11 12:07 PM, Logi Ragnarsson wrote: > Hello, > > Is it supposed to be possible to do a filled contour plot with alpha > levels in the colour map? I'm plotting weather data on top of maps and > would very much like to plot low levels of wind and precipitation as > mostly transparent, wit

Re: [Matplotlib-users] contourf: matplotlib.path.Path are LINETOs?

2011-12-13 Thread Eric Firing
On 12/13/2011 11:03 AM, Nico Schlömer wrote: > Hi all, > > when drawing contourf plots, I inspected the underlying > matplotlib.path.Path elements that determine the curves and noticed > that they are all of code LINETO (see > http://matplotlib.sourceforge.net/api/path_api.html#matplotlib.path.Path

Re: [Matplotlib-users] contourf shows a unwanted white space

2010-07-07 Thread Benjamin Root
Bala, the white space you see is due to contourf trying to have the axes ticks end on a round number. If you don't want that behavior, you can set the limits of the plot after calling contourf() with something like this: contourf(X, Y, Z) xlim(x_min, x_max) ylim(y_min, y_max) presuming you woul

Re: [Matplotlib-users] contourf creats white-like lines (or gaps) between each two color patches

2010-04-12 Thread Tsviki Hirsh
My simple way to solve the white-lines issue is simply to give the contourf command twice: contourf(x,y,z) contourf(x,y,z) The white lines are magically disappearing, also in png files. This works well also with alpha<1 Tsviki Hirsh > What version of mpl are you using? My mpl version is 0.99.1

Re: [Matplotlib-users] contourf creats white-like lines (or gaps) between each two color patches

2010-04-12 Thread lmkli
> CS = contourf(Z) > for c in CS.collections: > c.set_antialiased(False) Eric, Thank you! I like this very much! So, the last thing is, is there any way to set this antialiased feature to False by default? efiring wrote: > > lmkli wrote: >>> What version of mpl are you using? >> My mpl v

Re: [Matplotlib-users] contourf creats white-like lines (or gaps) between each two color patches

2010-04-11 Thread Eric Firing
lmkli wrote: >> What version of mpl are you using? > My mpl version is 0.99.1 > >> Are you modifying the default anti-aliasing in the patch collections that >> contour is creating? > Could you please tell me how to this? I am very new to matplotlib, thank you > very much if you can give me some

Re: [Matplotlib-users] contourf creats white-like lines (or gaps) between each two color patches

2010-04-11 Thread lmkli
> What version of mpl are you using? My mpl version is 0.99.1 > Are you modifying the default anti-aliasing in the patch collections that > contour is creating? Could you please tell me how to this? I am very new to matplotlib, thank you very much if you can give me some advices. >Are you seei

Re: [Matplotlib-users] contourf problem

2010-03-30 Thread Alan G Isaac
> 2010/3/29 Alan G Isaac : > > Can you explain this: > > norm = colors.Normalize(vmin = -1, vmax = 1) On 3/28/2010 10:05 PM, Friedrich Romstedt wrote: > The normaliser takes some arbitrary value and returns a value in [0, > 1]. Hence the name. The value \in [0, 1] is handed over to the > cma

Re: [Matplotlib-users] contourf problem

2010-03-28 Thread Friedrich Romstedt
2010/3/29 Alan G Isaac : > Can you explain this: > norm = colors.Normalize(vmin = -1, vmax = 1) The normaliser takes some arbitrary value and returns a value in [0, 1]. Hence the name. The value \in [0, 1] is handed over to the cmap's __call__(), resulting in the color value. And yes, I guess y

Re: [Matplotlib-users] contourf problem

2010-03-28 Thread Alan G Isaac
On 3/28/2010 7:19 PM, Friedrich Romstedt wrote: > I fixed your problem Can you explain this: norm = colors.Normalize(vmin = -1, vmax = 1) I take it that this scales the range for the color bar, which is what 'luminance' must refer to in the docs? In which case, can we just set vmin and vmax as i

Re: [Matplotlib-users] contourf problem

2010-03-28 Thread Friedrich Romstedt
2010/3/29 Alan G Isaac : > OK, it's obvious one you point it out. > Sorry for the typo in the example. > > Now suppose I want a colorbar labelled at -1, 0, 1 > but the highest value realized is <1. Can I somehow > use ticks=(-1,0,1) anyway, or do I have to tick at > the realized limits and then la

Re: [Matplotlib-users] contourf problem

2010-03-28 Thread Alan G Isaac
On 3/28/2010 3:04 PM, Ryan May wrote: > it's just using indices, which run from 0 to 99. Since the limits > are 0 to 100, bam...white space because, indeed, there is no data. > OK, it's obvious one you point it out. Sorry for the typo in the example. Now suppose I want a colorbar labelled at

Re: [Matplotlib-users] contourf problem

2010-03-28 Thread Ryan May
On Sun, Mar 28, 2010 at 11:16 AM, Alan G Isaac wrote: > Using contourf in version 0.99.1, > I'm seeing an unwanted white strip to > the top and right, adjacent to the axes. > (In fact, the strip looks just wide > enough to underlay the ticks.) > > Alan Isaac > > PS Simple example: > > x = np.linsp

Re: [Matplotlib-users] contourf creats white-like lines (or gaps) between each two color patches

2010-03-25 Thread Eric Firing
lmkli wrote: > Thank you! > > I just thought there must be a solution. > I saw someone posted he can modified contour.py to fix this, but I failed. > :( > What version of mpl are you using? Are you modifying the default anti-aliasing in the patch collections that contour is creating? Are you

Re: [Matplotlib-users] contourf creats white-like lines (or gaps) between each two color patches

2010-03-22 Thread lmkli
Thank you! I just thought there must be a solution. I saw someone posted he can modified contour.py to fix this, but I failed. :( Marius 't Hart-3 wrote: > > Actually, it does not draw the polygon edges, but leaves small gaps > between them. Through those gaps you can see the background. (Thi

Re: [Matplotlib-users] contourf creats white-like lines (or gaps) between each two color patches

2010-03-22 Thread Marius 't Hart
Actually, it does not draw the polygon edges, but leaves small gaps between them. Through those gaps you can see the background. (This also happens with polar plots and other polygons by the way.) I consider this a bug, though there are ways around it. For contour plots one can plot two contour

Re: [Matplotlib-users] contourf doesn't like a rectangular grid

2010-03-11 Thread Friedrich Romstedt
I deem it useful if you would add a print map_XX.shape, map_YY.shape, y.shape . I'm suspicious about their shape. _check_xyz() accepts 2D X,Y-arrays only if their shape is equal to that of y (y in your case). Friedrich --

Re: [Matplotlib-users] contourf doesn't like a rectangular grid

2010-03-08 Thread Shrividya Ravi
Hi there, I think I made a mistake with putting in a tuple in my first email, but here is the error output from the contourf that I call within a script. I use this script before with a square grid and there is no problem. Anyway, after your email, I played with the script again and I think I have

Re: [Matplotlib-users] contourf doesn't like a rectangular grid

2010-03-07 Thread Eric Firing
Shrividya Ravi wrote: > Hi all, > I have been using contourf quite happily with a square number of grid > points. e.g. a 20 by 20 grid. I recently decided to do a contourf plot > of a 20 by 15 grid (300 points) and I get errors. Unfortunately, I am > plotting experimental data so I cannot really

Re: [Matplotlib-users] contourf() color mapping

2010-02-02 Thread James Conners
Great. Just what I needed. I appreciate it. - James On Feb 2, 2010, at 1:56 PM, Eric Firing wrote: > James Conners wrote: >> Hi, >> >> I'm having some trouble producing a filled contour how I want it. >> >> Say I'm plotting data over the range [1.2, 20] using 15 level lines evenly >> spa

Re: [Matplotlib-users] contourf() color mapping

2010-02-02 Thread Eric Firing
James Conners wrote: > Hi, > > I'm having some trouble producing a filled contour how I want it. > > Say I'm plotting data over the range [1.2, 20] using 15 level lines evenly > spaced > over that interval. I'd like the min of that interval to map to the min of > the color spectrum (say "jet"

Re: [Matplotlib-users] Contourf( )

2009-11-02 Thread Eric Firing
R. Mitra wrote: > Hello All >Thanks a lot Eric. I think I have some module missing but I cannot > figure out what it is. I get the following. Any idea. This started > hapening after I reinstalled matplotlib. This is a numpy installation or version problem--notice that at the bottom of t

Re: [Matplotlib-users] Contourf( )

2009-11-02 Thread R. Mitra
Hello All Thanks a lot Eric. I think I have some module missing but I cannot figure out what it is. I get the following. Any idea. This started hapening after I reinstalled matplotlib. File "/Users/Kennel/Pythoncodes/coolingmodel.py", line 6, in import matplotlib File "/Lib

Re: [Matplotlib-users] Contourf( )

2009-11-01 Thread Eric Firing
R. Mitra wrote: > Hi > I am having problems with contourf(). Suppose I have two 10X30 > arrays X,Y and a corresponding Z value array. How do I make the > upper left to be the origin? I cannot use contour (Z,origin='upper') > because the axis values gets messed up. It sounds like maybe y

Re: [Matplotlib-users] contourf interpolation/smoothness

2009-08-13 Thread P.R.
P.R. -Original Message- From: Jeff Whitaker [mailto:jsw...@fastmail.fm] Sent: 2009-08-13 10:56 AM To: P.R. Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] contourf interpolation/smoothness P.R. wrote: > Jeff, > One more question: > Given two arbitrary X&Y a

Re: [Matplotlib-users] contourf interpolation/smoothness

2009-08-13 Thread Jeff Whitaker
lats and lons defining the output grid by dividing the input grid size by 2. Is there something in the docstring that is not clear? -Jeff > -Original Message- > From: Jeff Whitaker [mailto:jsw...@fastmail.fm] > Sent: 2009-08-13 7:15 AM > To: Eric Firing > Cc: P.R.; matp

Re: [Matplotlib-users] contourf interpolation/smoothness

2009-08-13 Thread P.R.
n handle arbitrary grid sizes & resolutions, so I can't just hard-code the X&Y sizes for the finer grid. Any ideas? Thanks, P.Romero -Original Message- From: Jeff Whitaker [mailto:jsw...@fastmail.fm] Sent: 2009-08-13 7:15 AM To: Eric Firing Cc: P.R.; matplotlib-users@lists.sourceforge.ne

Re: [Matplotlib-users] contourf interpolation/smoothness

2009-08-13 Thread P.R.
Jeff, Perfect. I'll give that a try... Thanks again, P.R. -Original Message- From: Jeff Whitaker [mailto:jsw...@fastmail.fm] Sent: 2009-08-13 7:15 AM To: Eric Firing Cc: P.R.; matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] contourf interpolation/smoot

Re: [Matplotlib-users] contourf interpolation/smoothness

2009-08-13 Thread Jeff Whitaker
Eric Firing wrote: > P.R. wrote: > >> This has probably been asked before, so I apologize... >> >> Is it possible to improve the smoothness/interpolation used in contourf? >> I know that the interpolation can be set for imshow(pcolor?), but I couldn't >> see how to set it for contourf. >> >> Rig

Re: [Matplotlib-users] contourf interpolation/smoothness

2009-08-12 Thread Eric Firing
P.R. wrote: > This has probably been asked before, so I apologize... > > Is it possible to improve the smoothness/interpolation used in contourf? > I know that the interpolation can be set for imshow(pcolor?), but I couldn't > see how to set it for contourf. > > Right now, contourf is producing s

Re: [Matplotlib-users] contourf: black lines connecting contour levels?

2009-07-04 Thread Rick Muller
Beautiful! The SVN version worked well for this. I forgot to check whether the workaround for version 0.98.5.3 worked; you may be right, and I may have simply forgotten to redraw the figure, but I think I did so (I normally kill my windows between plotting). Thanks very much for your help with th

Re: [Matplotlib-users] contourf: black lines connecting contour levels?

2009-07-03 Thread Jae-Joon Lee
The example in the cookbool works fine with svn version of mpl. So, it seems that this bug has been fixed. Anyhow, which command (contour or contourf) draws the vertical lines? I bet it is contourf. And set_edgecolor("none") for return value of contourf should have some effect. Did you redraw the

Re: [Matplotlib-users] contourf: black lines connecting contour levels?

2009-07-02 Thread Rick Muller
Oh, and I'm using the Agg backend, I think, whatever is the default. On Thu, Jul 2, 2009 at 7:19 PM, Rick Muller wrote: > JJ > > Thanks for the tips. I had seen one of those posts whilst googling around > for the bug, but discounted it because I'm not using an alpha value. > > Here are links to

Re: [Matplotlib-users] contourf: black lines connecting contour levels?

2009-07-02 Thread Rick Muller
JJ Thanks for the tips. I had seen one of those posts whilst googling around for the bug, but discounted it because I'm not using an alpha value. Here are links to one of the cookbook examples, and one of the files that I want to plot: http://files.getdropbox.com/u/533499/griddata-test.png http:/

Re: [Matplotlib-users] contourf: black lines connecting contour levels?

2009-07-02 Thread Jae-Joon Lee
The dropbox link is broken (you need a public url). What version of mpl and what backend are you using? There was a similar problem which has now been fixed. Try the work-around described in the thread below, and see if works. http://www.nabble.com/problems-with-contourf---alpha-td22553269.html

Re: [Matplotlib-users] contourf/colorbar logarithmic value scale

2009-05-12 Thread Christian K .
Christian K. writes: > > Hi, > > could someone please point me to an example which shows how to achieve a filled > contour plot with a logarithmic value scale both for the contour data and the > colorbar? > > Thanks in advance, Christian > I just noticed that this has been discussed recen

Re: [Matplotlib-users] contourf with preassigned range

2007-11-12 Thread Eric Firing
Thomas Schmelzer wrote: > Hello experts, > I have two matrices (one random matrix with entries between -3 and +3 > and one with entries say between -4 and 4). > I would like to plot a contourf for both of them with corresponding > color scheme (ranging say from -5 to 5). > I am a newbie, so pleas

Re: [Matplotlib-users] contourf & imshow logarithmic colormap

2007-10-31 Thread John
That is one solution, but perhaps I should have asked about a solution for contourf as well. It would be preferable to be able to use a logarithmic colormap rather than translating the variable. - This SF.net email is sponsored

Re: [Matplotlib-users] contourf & imshow logarithmic colormap

2007-10-30 Thread Eric Firing
washakie wrote: > Hello, > > I'm trying to find a way to use imshow or contourf with a logarithmic > colormap. Searching the threads I've found a few queries about this before, > but not a solution. Any suggestions? > > Thanks! Maybe I am not understanding correctly, but could you simply plot th

Re: [Matplotlib-users] contourf question

2007-10-05 Thread Eric Firing
[EMAIL PROTECTED] wrote: > Thanks again Eric, > > Your examples are exactly what I was after. Glad to hear it! > My colleague was hypothesizing that there's probably a less-than instead of a > less-than-or-equal somewhere, if it is a bug. > That was part of it, but it was a little more subtle

Re: [Matplotlib-users] contourf question

2007-10-04 Thread [EMAIL PROTECTED]
Thanks again Eric, Your examples are exactly what I was after. My colleague was hypothesizing that there's probably a less-than instead of a less-than-or-equal somewhere, if it is a bug. regards, Gary Eric Firing <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Thanks Eric. > >

Re: [Matplotlib-users] contourf question

2007-10-04 Thread Eric Firing
[EMAIL PROTECTED] wrote: > Thanks Eric. > > However, when I specify the same number of levels as suggested, contourf > divides this example into three regions, with a diagonal 'stripe' instead of > a clean boundary, so I guess I'm asking whether it's possible to trick > contourf into generating

Re: [Matplotlib-users] contourf question

2007-10-04 Thread [EMAIL PROTECTED]
Thanks Eric. However, when I specify the same number of levels as suggested, contourf divides this example into three regions, with a diagonal 'stripe' instead of a clean boundary, so I guess I'm asking whether it's possible to trick contourf into generating a single boundary between the two re