You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(24) |
2
(35) |
3
(21) |
4
(15) |
5
(1) |
|
6
(2) |
7
(30) |
8
(16) |
9
(11) |
10
(10) |
11
(10) |
12
(4) |
|
13
(2) |
14
(14) |
15
(21) |
16
(7) |
17
(5) |
18
(2) |
19
(5) |
|
20
|
21
(4) |
22
(8) |
23
(4) |
24
(6) |
25
(2) |
26
(2) |
|
27
(5) |
28
(9) |
29
(16) |
30
(14) |
31
(5) |
|
|
|
From: Ryan N. <rya...@gm...> - 2009-12-03 20:40:22
|
Thank You,
I think I have a better understanding. In my figure, there are six axes,
three for the plots: grid[i] and three for their colorbars:
grid.cbar_axes[i].
I changed my code as you suggested and got something like:
[image: UKM0g.png]
I tried all sorts of things, but finally, by setting aspect=False I got it
to work. In the documentation, the table says this defaults to True and the
explanation of aspect below says it defaults to False. Although I don't
entirely understand what is going on, I think this threw me off.
So then I had this:
[image: 84Kna.png]
... which looks much better, except that there are two sets of x and y axis
labels? This seems to have something to do with the colorbar. I've got:
label_mode = "L",
cbar_location="right",
cbar_mode="each",
cbar_size="2%",
cbar_pad="0.5%"
Now I'm trying to get scales and labels on my colorbars.
I tried:
for i,parameter in enumerate(z_dim):
ax = my_grid[i].pcolor(x_grid,y_grid,z_dim[parameter]) # This is the
pcolor plot
my_grid[i].set_ylabel('Depth') # Correctly puts a y label on every plot.
cb = my_grid.cbar_axes[i].colorbar(ax) # Puts in a colorbar for this
axes?s
cb.set_ylabel(parameter) #It would be nice if this was on the far right
next to the colorbar. I don't see it anywhere. Perhaps underneath something?
[image: DPkWz.png]
It looks like perhaps the colorbar axes is inside the ax axes rather than
besides it?
In the demo_grid_with_each_cbar<http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_grid.html>example,
how would you put a scale and label on the colorbar like in this
plot:?
[image: 58dFK.png]
I can put a y_label on each contour plot, but since they all have depth, I'd
like to label this only once.
Is there a way to label the entire AxesGrid (or is that subplot?)?
Thank you very much for your help,
-Ryan
On Wed, Dec 2, 2009 at 10:21 PM, Jae-Joon Lee <lee...@gm...> wrote:
> This happens because, when the AxesGrid is created, gca() is set to the
> last axes, which is the last colobar axes.
>
> If you use axes_grid toolkit, you'd better not use pyplot command that
> works on axes. Instead, use axes method directly.
>
> For example, instead of "pyplot.pcolor(..)" , use "ax.pcolor(..)".
>
> Regards,
>
> -JJ
>
>
>
>
> On Wed, Dec 2, 2009 at 2:18 PM, Ryan Neve <rya...@gm...> wrote:
>
>> Hello,
>>
>> I'm trying to use AxesGrid but I'm running into a problem:
>> I can plot a single pcolor plot:
>> [image: 58dFK.png]
>> But when I try to use AxesGrid, my pcolor plot is ending up where I expect
>> my colorbar to be.
>> [image: mEbTA.png]
>>
>> I want to have up to 6 of these plots stacked vertically, sharing a common
>> time axis and y (depth) scale.
>>
>> I'll try to simplify my code to show what I'm doing:
>>
>> # I have arrays x_grid and y_grid for time and water depth.
>> # z_dim is a dictionary of arrays (one for each plot)
>> # In the plot above it has two arrays.
>> from matplotlib import pyplot
>> nrows = len(z_dim) # Number of rows is the number of arrays
>> My_figure = pyplot.figure(1,(8,8))
>> my_grid = AxesGrid(My_figure, 111, #Is this always 111?
>> nrows_ncols = (nrows,1), # Always one column
>> axes_pad = 0.1,
>> add_all=True,
>> share_all=True, # They all share the same time and depth
>> scales
>> label_mode = "L",
>> cbar_location="right",
>> cbar_mode="each",
>> cbar_size="7%",
>> cbar_pad="2%",
>> )
>> for row_no,parameter in enumerate(z_dim):
>> ax = my_grid[row_no]
>> ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
>> pyplot.draw()
>> pyplot.show()
>>
>> I eventually want to end up with something like this matlab output (which
>> I didn't generate):
>> [image: jiIaK.png]
>> but without the duplication of x scales.
>>
>> I'm new to pyplot and even after reading the documentation much of this is
>> baffling.
>>
>> -Ryan
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>> a free event focused on virtualization and cloud computing.
>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>> http://p.sf.net/sfu/redhat-sfdev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
|
|
From: Peter I. H. <pe...@gm...> - 2009-12-03 19:15:34
|
Hi All Not really about matplotlib, but since the load() function was removed it seems we have to use numpy.loadtxt in stead. I'm reading some datafiles that have comment line beginning with both '#' and '@'. Is there a way to assign two different values to the 'comments' keyword? Thanks, Peter |
|
From: Jae-Joon L. <lee...@gm...> - 2009-12-03 18:30:38
|
You need to add the patch to the second axes.
patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data',
axesA=ax1, axesB=ax2,
zorder=100, arrowstyle='fancy',
connectionstyle='Angle3',
mutation_scale=10)
ax2.add_patch(patch)
However, this does not work right out of the box currently (which
should be bug).
As a workaround, add a following line and it will work.
patch.set_annotation_clip(False)
It would be appreciated if you file a bug report for a future reference.
http://sourceforge.net/tracker/?atid=560720&group_id=80706&func=browse
Regards,
-JJ
On Thu, Dec 3, 2009 at 9:31 AM, Stephane Raynaud
<ste...@gm...> wrote:
> Hi,
>
> how to make this arrow not disappear below the right plot?
> Here is the code :
>
> ------------------------------------------------------------
> from matplotlib.patches import *
> import matplotlib.pyplot as P
>
> P.figure(figsize=(5, 3))
> ax1 = P.subplot(121)
> P.plot([0, 1])
> ax2 = P.subplot(122)
> P.plot([0, 1])
>
>
> patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data', axesA=ax1,
> axesB=ax2,
> zorder=100, arrowstyle='fancy',clip_on=False, connectionstyle='Angle3',
> mutation_scale=100)
> ax1.add_patch(patch)
>
> P.savefig('cross_arrow.png')
> P.show()
> ------------------------------------------------------------
>
>
>
>
> --
> Stephane Raynaud
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Jouni K. S. <jk...@ik...> - 2009-12-03 18:05:56
|
Matthias Michler <Mat...@gm...> writes: > Do you know why is happens only for ps/eps-files? The ps backend uses TeX in a different way than the other backends. It uses psfrag and dvips to construct the final file. >> Have you set any TeX-related environment variables or edited any >> configuration files? What does "kpsepath tex" print? > > in my .zshrc I set > TEXINPUTS=~/Texte/Styles//:.//: It's probably the .// entry, which causes TeX to search all subdirectories of the current directory. The ps backend does something like cd /tmp && latex file.tex so it should just look in subdirectories of the temporary directory, but perhaps it somehow goes awry. Do you have some setting that causes temporary files to end up in the root directory? -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: Jorge S. <jor...@ya...> - 2009-12-03 09:17:32
|
Jae-Joon Lee <lee.j.joon@...> writes: <...> > > It depends on your mileage. > > However, a patch in matplotlib usually means a closed path. If you add > additional lines, you need to be careful not to mess the filling of > the rectangle. > > I guess it would better to simply use separate artists for additional > lines you want. You may create a container artist for patches and > lines if you want. > > Regards, > > -JJ Thanks, that's sounds like a better way indeed. I'll work in this direction. Jorge |
|
From: marcusantonius <mar...@st...> - 2009-12-03 08:49:09
|
Thak you very much for pointing this out to me. I was not aware that Inkscape is able to output to .odg. Unfortunatly export into .odg works badly. I converted .svg files, and both were rendered totally incorrect. All the axes labels vanished, in a lineplot it connected the end of the line to the origin, leading to a diagonal line which should not be there, and the rasterized image included by pcolorfast was also not included. Therefore I fear that exporting into .odg is not a usable alternative. -- View this message in context: http://old.nabble.com/Output-to-any-vector-format-openoffice-can-use-tp26589911p26621731.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jae-Joon L. <lee...@gm...> - 2009-12-03 04:36:44
|
This would only meaningful if you set contour levels manually.
plt.figure()
levels = [-1, 0, 1]
fmt = {-1.:"-1",
0.:"0",
1.:"+1"}
CS = plt.contour(X, Y, Z, levels)
plt.clabel(CS, inline=1, fontsize=10, fmt=fmt)
Regards,
-JJ
On Wed, Dec 2, 2009 at 6:32 AM, Momme Butenschön <mo...@ya...> wrote:
> in the help for the countour plot labeling it says:
> *fmt*:
> a format string for the label. Default is '%1.3f'
> Alternatively, this can be a dictionary matching contour
> levels with arbitrary strings to use for each contour level
> (i.e., fmt[level]=string)
> can somebody enlighten me how this works?
> how do I connect levels to what dictionary keyword?
>
> thank a lot,
> Momme
>
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-12-03 03:35:07
|
On Tue, Dec 1, 2009 at 8:48 AM, Jorge Scandaliaris <jor...@ya...> wrote: > How difficult would be to extend the Rectangle class so besides its permimeter > it draws lines showing halfs or thirds of the width and height? It depends on your mileage. However, a patch in matplotlib usually means a closed path. If you add additional lines, you need to be careful not to mess the filling of the rectangle. I guess it would better to simply use separate artists for additional lines you want. You may create a container artist for patches and lines if you want. Regards, -JJ |
|
From: Jae-Joon L. <lee...@gm...> - 2009-12-03 03:22:14
|
This happens because, when the AxesGrid is created, gca() is set to the last axes, which is the last colobar axes. If you use axes_grid toolkit, you'd better not use pyplot command that works on axes. Instead, use axes method directly. For example, instead of "pyplot.pcolor(..)" , use "ax.pcolor(..)". Regards, -JJ On Wed, Dec 2, 2009 at 2:18 PM, Ryan Neve <rya...@gm...> wrote: > Hello, > > I'm trying to use AxesGrid but I'm running into a problem: > I can plot a single pcolor plot: > [image: 58dFK.png] > But when I try to use AxesGrid, my pcolor plot is ending up where I expect > my colorbar to be. > [image: mEbTA.png] > > I want to have up to 6 of these plots stacked vertically, sharing a common > time axis and y (depth) scale. > > I'll try to simplify my code to show what I'm doing: > > # I have arrays x_grid and y_grid for time and water depth. > # z_dim is a dictionary of arrays (one for each plot) > # In the plot above it has two arrays. > from matplotlib import pyplot > nrows = len(z_dim) # Number of rows is the number of arrays > My_figure = pyplot.figure(1,(8,8)) > my_grid = AxesGrid(My_figure, 111, #Is this always 111? > nrows_ncols = (nrows,1), # Always one column > axes_pad = 0.1, > add_all=True, > share_all=True, # They all share the same time and depth > scales > label_mode = "L", > cbar_location="right", > cbar_mode="each", > cbar_size="7%", > cbar_pad="2%", > ) > for row_no,parameter in enumerate(z_dim): > ax = my_grid[row_no] > ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter]) > pyplot.draw() > pyplot.show() > > I eventually want to end up with something like this matlab output (which I > didn't generate): > [image: jiIaK.png] > but without the duplication of x scales. > > I'm new to pyplot and even after reading the documentation much of this is > baffling. > > -Ryan > > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: gbollenbach <whi...@ya...> - 2009-12-03 02:17:36
|
Inkscape's native format is svg and it exports in .odg, which OO should be able to use. I did a test combining a svg vector and png raster and then saving as .odg, and it wrote the file. But I don't have OO so I can't try to import the result. regards, Gary B marcusantonius wrote: > > I am searching a way, so that I can insert my matplotlib graphs as vector > data in openoffice. I make colormaps using pcolorfast. If I save the > figure as emf, the colormap inside the axes vanishes, because the normal > emf backend cannot include rasterized data. Is there any way (e.g. using a > different backend) which gives emf/wmf files which contain the rasterized > data? > > Is there a convertor from svg to emf which can do the trick? (I tried > uniconvertor but it also looses the rasterized data). I tried to insert > svg/eps/pdf files into openoffice, but the results are less than promising > -- View this message in context: http://old.nabble.com/Output-to-any-vector-format-openoffice-can-use-tp26589911p26619988.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jae-Joon L. <lee...@gm...> - 2009-12-03 00:44:12
|
On Sun, Nov 22, 2009 at 11:16 AM, per freem <per...@gm...> wrote:
> is there an existing parameter that just controls the distance between
> the xticks and the label?
As you first tried (with your example with axes_grid), labelpad
parameter does what you want.
plt.xlabel("xlabel", labelpad=0)
or
ax.xaxis.labelpad = 0
It didn't work in your previous example because you were using
axes_grid toolkit, that simply ignores this parameter.
Also, see this
http://matplotlib.sourceforge.net/faq/howto_faq.html#align-my-ylabels-across-multiple-subplots
Regards,
-JJ
|
|
From: Christopher B. <Chr...@no...> - 2009-12-02 23:27:27
|
Christopher Barker wrote: > The diskimage is usually built for the python binary supplied by > python.org -- that is what the message means by the "system version". I > tried to submit a patch to change that message a year or two ago, but I > guess it never got applied -- maybe I'll try again. I took a look at the source for the latest bdist_mpkg -- it looks like it should now give a message like: "This package requires MacPython to be installed" though It's all a bit complicated -- did whoever built the dmg use the latest bdist_mpkg? But maybe should still do: > A note to developers/distributors: > > Robin Dunn figured out a way to install a binary wxPython that will work > with both the Apple and the python.org binaries. What it does it put it > in /usr/local, and then put a pth file in both of the pythons so that it > can be found. A bit of a hack, but it works, and I've never heard anyone > have a problem with it. > > Perhaps we should do the same thing with MPL -- I'm sure he'd be glad to > share his scripts for building it. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Christopher B. <Chr...@no...> - 2009-12-02 23:21:10
|
Lisa M Winter wrote: > 1) The diskimage installation: When I open the installer, I am told > that I can not install matplotlib on my disk because I do not have a > system version of python 2.6. I do not understand this error since I > am running the default version (which is 2.6.1). The diskimage is usually built for the python binary supplied by python.org -- that is what the message means by the "system version". I tried to submit a patch to change that message a year or two ago, but I guess it never got applied -- maybe I'll try again. A note to developers/distributors: Robin Dunn figured out a way to install a binary wxPython that will work with both the Apple and the python.org binaries. What it does it put it in /usr/local, and then put a pth file in both of the pythons so that it can be found. A bit of a hack, but it works, and I've never heard anyone have a problem with it. Perhaps we should do the same thing with MPL -- I'm sure he'd be glad to share his scripts for building it. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: William C. <wcc...@lb...> - 2009-12-02 22:58:18
|
You're right--that's pretty simple. I ran that exact code and it worked fine. Don't know what to say except that this is above my competence level to dig into the guts of tk. Looks like a problem for John Hunter. Sorry I couldn't help more, Bill On 12/2/09 2:49 PM, "Lisa M Winter" <Lis...@Co...> wrote: > from pylab import * > plot([1,2,3]) > show() |
|
From: Lisa M W. <Lis...@Co...> - 2009-12-02 22:49:42
|
Sure. This is all that it is:
from pylab import *
plot([1,2,3])
show()
On Dec 2, 2009, at 3:42 PM, William Carithers wrote:
> Hi Lisa,
>
> Hmm. I also use TKAgg with no problems. Looking at your code, it
> looks like
> you are trying the first example in the tutorial. Just to be sure,
> could you
> post/send a full listing of your simple_plot.py?
>
> Thanks,
> Bill
>
> On 12/2/09 2:01 PM, "Lisa M Winter" <Lis...@Co...> wrote:
>
>> Thanks for the pointers, Bill.
>>
>> I tried installing from source as you suggested, but I am getting the
>> same errors when I try to plot. What backend are you using?
>>
>> Here is what I get when I try using TkAgg:
>>
>> casa98-125-dhcp:.matplotlib lisa$ python simple_plot.py --verbose-
>> helpful
>> $HOME=/Users/lisa
>> matplotlib data path /Users/lisa/.local/lib/python2.6/site-packages/
>> matplotlib/mpl-data
>> loaded rc file /Users/lisa/.matplotlib/matplotlibrc
>> matplotlib version 0.99.1.1
>> verbose.level helpful
>> interactive is True
>> units is False
>> platform is darwin
>> CONFIGDIR=/Users/lisa/.matplotlib
>> Using fontManager instance from /Users/lisa/.matplotlib/
>> fontList.cache
>> backend TkAgg version 8.5
>> Traceback (most recent call last):
>> File "simple_plot.py", line 2, in <module>
>> plot([1,2,3])
>> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> pyplot.py", line 2134, in plot
>> ax = gca()
>> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> pyplot.py", line 582, in gca
>> ax = gcf().gca(**kwargs)
>> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> pyplot.py", line 276, in gcf
>> return figure()
>> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> pyplot.py", line 254, in figure
>> **kwargs)
>> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> backends/backend_tkagg.py", line 91, in new_figure_manager
>> canvas = FigureCanvasTkAgg(figure, master=window)
>> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
>> backends/backend_tkagg.py", line 158, in __init__
>> master=self._tkcanvas, width=w, height=h)
>> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
>> python2.6/lib-tk/Tkinter.py", line 3284, in __init__
>> Image.__init__(self, 'photo', name, cnf, master, **kw)
>> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
>> python2.6/lib-tk/Tkinter.py", line 3240, in __init__
>> self.tk.call(('image', 'create', imgtype, name,) + options)
>> _tkinter.TclError: integer value too large to represent
>>
>>
>> Lisa
>>
>>
>> On Dec 2, 2009, at 2:17 PM, William Carithers wrote:
>>
>>> Hi Lisa,
>>>
>>> I had lots of trouble installing on 10.6 as well. What finally
>>> worked for me
>>> is to use the (recommended) file make.osx that comes with the
>>> matplotlib
>>> download. You have to edit that file to point to the versions of
>>> Python (you
>>> want 2.6) and OSX (you want 10.6). I'm attaching a version that has
>>> all
>>> these edits already made. (I'm assuming you have an intel Mac, not a
>>> ppc).
>>>
>>> Look at the top of the file and you will see an example command line
>>> that
>>> begins with PREFIX. You'll execute that command line with the
>>> example
>>> directory changed to your directory and I highly recommend choosing
>>> the
>>> directory /Users/(whatever your user name is)/.local All the
>>> libraries will
>>> be installed there and Python will know how to find them even
>>> without
>>> explicitly putting them in any PATH variable. This command line will
>>> even
>>> check for required dependencies like freetype2, pnglib, ... And will
>>> go them
>>> and install them for you if you don't already have them. The command
>>> line
>>> should look like:
>>> sudo PREFIX=/Users/(your username)/.local make -f make.osx fetch
>>> deps
>>> mpl_install
>>>
>>> Good luck,
>>> Bill
>>> On 12/2/09 12:31 PM, "Lisa M Winter" <Lis...@Co...>
>>> wrote:
>>>
>>>> Hello.
>>>>
>>>> I am finding it very difficult to install matplotlib with snow
>>>> leopard. I have the Apple XCODE installed along with numpy
>>>> (which I
>>>> have tested and works) and am running the python 2.6 version that
>>>> comes with the Mac.
>>>>
>>>> I have run into the following problems:
>>>> 1) The diskimage installation: When I open the installer, I am told
>>>> that I can not install matplotlib on my disk because I do not
>>>> have a
>>>> system version of python 2.6. I do not understand this error
>>>> since I
>>>> am running the default version (which is 2.6.1).
>>>>
>>>> 2) As another person on the list pointed out, easy_install
>>>> matplotlib
>>>> tries to install an older version that does not work with the newer
>>>> version of numpy.
>>>>
>>>> 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg. I was able to
>>>> install matplotlib, seemingly. When I import pylab into python,
>>>> I do
>>>> not get any errors. However, I do get an error when I try to plot.
>>>> With the default backend TkAgg (version 8.5), I get the following
>>>> error when I try to plot:
>>>> _tkinter.TclError: integer value too large to represent
>>>>
>>>> When I try to change the backend to MacOSX, a window opens labeled
>>>> Figure 1, but nothing plots. With the verbose level on helpful, I
>>>> find only that "backend MacOSX version unknown".
>>>>
>>>> Has anyone seen any of these problems before and have an idea as to
>>>> how to fix this? If not, is there another method that I should try
>>>> (I'm hesitant to try to build/install from the source).
>>>>
>>>> Thank you for any help!
>>>>
>>>> ----------------------------------------------------------------------------
>>>> --
>>>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>>>> a free event focused on virtualization and cloud computing.
>>>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>>>> http://p.sf.net/sfu/redhat-sfdev2dev
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>> <
>>> make.osx
>>>>
>>>
> ----------------------------------------------------------------------------->
> >
> -
>>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>>> a free event focused on virtualization and cloud computing.
>>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>>> http://p.sf.net/sfu/redhat-sfdev2dev_________________________________________
>>> ______
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: William C. <wcc...@lb...> - 2009-12-02 22:43:04
|
Hi Lisa,
Hmm. I also use TKAgg with no problems. Looking at your code, it looks like
you are trying the first example in the tutorial. Just to be sure, could you
post/send a full listing of your simple_plot.py?
Thanks,
Bill
On 12/2/09 2:01 PM, "Lisa M Winter" <Lis...@Co...> wrote:
> Thanks for the pointers, Bill.
>
> I tried installing from source as you suggested, but I am getting the
> same errors when I try to plot. What backend are you using?
>
> Here is what I get when I try using TkAgg:
>
> casa98-125-dhcp:.matplotlib lisa$ python simple_plot.py --verbose-
> helpful
> $HOME=/Users/lisa
> matplotlib data path /Users/lisa/.local/lib/python2.6/site-packages/
> matplotlib/mpl-data
> loaded rc file /Users/lisa/.matplotlib/matplotlibrc
> matplotlib version 0.99.1.1
> verbose.level helpful
> interactive is True
> units is False
> platform is darwin
> CONFIGDIR=/Users/lisa/.matplotlib
> Using fontManager instance from /Users/lisa/.matplotlib/fontList.cache
> backend TkAgg version 8.5
> Traceback (most recent call last):
> File "simple_plot.py", line 2, in <module>
> plot([1,2,3])
> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> pyplot.py", line 2134, in plot
> ax = gca()
> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> pyplot.py", line 582, in gca
> ax = gcf().gca(**kwargs)
> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> pyplot.py", line 276, in gcf
> return figure()
> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> pyplot.py", line 254, in figure
> **kwargs)
> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> backends/backend_tkagg.py", line 91, in new_figure_manager
> canvas = FigureCanvasTkAgg(figure, master=window)
> File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
> backends/backend_tkagg.py", line 158, in __init__
> master=self._tkcanvas, width=w, height=h)
> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/lib-tk/Tkinter.py", line 3284, in __init__
> Image.__init__(self, 'photo', name, cnf, master, **kw)
> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/lib-tk/Tkinter.py", line 3240, in __init__
> self.tk.call(('image', 'create', imgtype, name,) + options)
> _tkinter.TclError: integer value too large to represent
>
>
> Lisa
>
>
> On Dec 2, 2009, at 2:17 PM, William Carithers wrote:
>
>> Hi Lisa,
>>
>> I had lots of trouble installing on 10.6 as well. What finally
>> worked for me
>> is to use the (recommended) file make.osx that comes with the
>> matplotlib
>> download. You have to edit that file to point to the versions of
>> Python (you
>> want 2.6) and OSX (you want 10.6). I'm attaching a version that has
>> all
>> these edits already made. (I'm assuming you have an intel Mac, not a
>> ppc).
>>
>> Look at the top of the file and you will see an example command line
>> that
>> begins with PREFIX. You'll execute that command line with the example
>> directory changed to your directory and I highly recommend choosing
>> the
>> directory /Users/(whatever your user name is)/.local All the
>> libraries will
>> be installed there and Python will know how to find them even without
>> explicitly putting them in any PATH variable. This command line will
>> even
>> check for required dependencies like freetype2, pnglib, ... And will
>> go them
>> and install them for you if you don't already have them. The command
>> line
>> should look like:
>> sudo PREFIX=/Users/(your username)/.local make -f make.osx fetch deps
>> mpl_install
>>
>> Good luck,
>> Bill
>> On 12/2/09 12:31 PM, "Lisa M Winter" <Lis...@Co...> wrote:
>>
>>> Hello.
>>>
>>> I am finding it very difficult to install matplotlib with snow
>>> leopard. I have the Apple XCODE installed along with numpy (which I
>>> have tested and works) and am running the python 2.6 version that
>>> comes with the Mac.
>>>
>>> I have run into the following problems:
>>> 1) The diskimage installation: When I open the installer, I am told
>>> that I can not install matplotlib on my disk because I do not have a
>>> system version of python 2.6. I do not understand this error since I
>>> am running the default version (which is 2.6.1).
>>>
>>> 2) As another person on the list pointed out, easy_install matplotlib
>>> tries to install an older version that does not work with the newer
>>> version of numpy.
>>>
>>> 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg. I was able to
>>> install matplotlib, seemingly. When I import pylab into python, I do
>>> not get any errors. However, I do get an error when I try to plot.
>>> With the default backend TkAgg (version 8.5), I get the following
>>> error when I try to plot:
>>> _tkinter.TclError: integer value too large to represent
>>>
>>> When I try to change the backend to MacOSX, a window opens labeled
>>> Figure 1, but nothing plots. With the verbose level on helpful, I
>>> find only that "backend MacOSX version unknown".
>>>
>>> Has anyone seen any of these problems before and have an idea as to
>>> how to fix this? If not, is there another method that I should try
>>> (I'm hesitant to try to build/install from the source).
>>>
>>> Thank you for any help!
>>>
>>> ----------------------------------------------------------------------------
>>> --
>>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>>> a free event focused on virtualization and cloud computing.
>>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>>> http://p.sf.net/sfu/redhat-sfdev2dev
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>> <
>> make.osx
>>>
>>
----------------------------------------------------------------------------->>
-
>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>> a free event focused on virtualization and cloud computing.
>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>> http://p.sf.net/sfu/redhat-sfdev2dev_________________________________________
>> ______
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Tony S Yu <ts...@gm...> - 2009-12-02 22:13:53
|
On Dec 2, 2009, at 3:53 PM, Tony S Yu wrote:
> Hi,
>
> I'm having hard time understanding some of the differences between functions used to plot color patches (not sure what to call them).
>
> I'm trying to fill a curve with a nonuniform color patch (like fill or fill_between but the color in the patch varies). I've attached code that almost does what I want; my question concerns the color patch (which is created by the call to plt.pcolor in the code below). I'd like to have nonuniform grid spacing in the color values, and also shading (i.e. interpolation of color between points). Here's what I understand:
>
> pcolor: allows nonuniform grid spacing, but it doesn't do shading.
>
> imshow: allows color shading, but requires uniform spacing
>
> pcolormesh: allows color interpolation and nonuniform grid spacing
>
> pcolormesh seems like the ideal candidate, but when I replace pcolor with pcolormesh (code commented out below pcolor call), the path doesn't get clipped by set_clip_path (but no errors are raised); in other words, the color shading fills the entire plot area. Is this a bug?
>
> Is there a way of making this plot work that I've overlooked?
>
> Thanks!
> -Tony
Nevermind, I found NonUniformImage after some digging. The working code is attached below if anyone is interested.
If anyone knows the answer, I'm still curious if the clipping behavior for pcolormesh is a bug.
Thanks,
-Tony
#~~~~ example code
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.image import NonUniformImage
def nonuniform_imshow(x, y, C, **kwargs):
"""Plot image with nonuniform pixel spacing.
This function is a convenience method for calling image.NonUniformImage.
"""
ax = plt.gca()
im = NonUniformImage(ax, **kwargs)
im.set_data(x, y, C)
ax.images.append(im)
return im
def plot_filled_curve(x, y, c):
"""Plot curve filled with linear color gradient
Parameters
----------
x, y : arrays
points describing curve
c : array
color values underneath curve. Must match the lengths of `x` and `y`.
"""
# add end points so that fill extends to the x-axis
x_closed = np.concatenate([x[:1], x, x[-1:]])
y_closed = np.concatenate([[0], y, [0]])
# fill between doesn't work here b/c it returns a PolyCollection, plus it
# adds the lower half of the plot by adding a Rect with a border
patch, = plt.fill(x_closed, y_closed, facecolor='none')
im = nonuniform_imshow(x, [0, y.max()], np.vstack((c, c)),
interpolation='bilinear', cmap=plt.cm.gray)
im.set_clip_path(patch)
if __name__ == '__main__':
line = np.linspace(0, 1, 6)
x = np.hstack((line, [1, 2]))
y = np.hstack((line**2, [1, 1]))
c = np.hstack((line, [0, 0]))
plot_filled_curve(x, y, c)
plt.show()
|
|
From: Lisa M W. <Lis...@Co...> - 2009-12-02 22:01:28
|
Thanks for the pointers, Bill.
I tried installing from source as you suggested, but I am getting the
same errors when I try to plot. What backend are you using?
Here is what I get when I try using TkAgg:
casa98-125-dhcp:.matplotlib lisa$ python simple_plot.py --verbose-
helpful
$HOME=/Users/lisa
matplotlib data path /Users/lisa/.local/lib/python2.6/site-packages/
matplotlib/mpl-data
loaded rc file /Users/lisa/.matplotlib/matplotlibrc
matplotlib version 0.99.1.1
verbose.level helpful
interactive is True
units is False
platform is darwin
CONFIGDIR=/Users/lisa/.matplotlib
Using fontManager instance from /Users/lisa/.matplotlib/fontList.cache
backend TkAgg version 8.5
Traceback (most recent call last):
File "simple_plot.py", line 2, in <module>
plot([1,2,3])
File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
pyplot.py", line 2134, in plot
ax = gca()
File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
pyplot.py", line 582, in gca
ax = gcf().gca(**kwargs)
File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
pyplot.py", line 276, in gcf
return figure()
File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
pyplot.py", line 254, in figure
**kwargs)
File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
backends/backend_tkagg.py", line 91, in new_figure_manager
canvas = FigureCanvasTkAgg(figure, master=window)
File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/
backends/backend_tkagg.py", line 158, in __init__
master=self._tkcanvas, width=w, height=h)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/lib-tk/Tkinter.py", line 3284, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/lib-tk/Tkinter.py", line 3240, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: integer value too large to represent
Lisa
On Dec 2, 2009, at 2:17 PM, William Carithers wrote:
> Hi Lisa,
>
> I had lots of trouble installing on 10.6 as well. What finally
> worked for me
> is to use the (recommended) file make.osx that comes with the
> matplotlib
> download. You have to edit that file to point to the versions of
> Python (you
> want 2.6) and OSX (you want 10.6). I'm attaching a version that has
> all
> these edits already made. (I'm assuming you have an intel Mac, not a
> ppc).
>
> Look at the top of the file and you will see an example command line
> that
> begins with PREFIX. You'll execute that command line with the example
> directory changed to your directory and I highly recommend choosing
> the
> directory /Users/(whatever your user name is)/.local All the
> libraries will
> be installed there and Python will know how to find them even without
> explicitly putting them in any PATH variable. This command line will
> even
> check for required dependencies like freetype2, pnglib, ... And will
> go them
> and install them for you if you don't already have them. The command
> line
> should look like:
> sudo PREFIX=/Users/(your username)/.local make -f make.osx fetch deps
> mpl_install
>
> Good luck,
> Bill
> On 12/2/09 12:31 PM, "Lisa M Winter" <Lis...@Co...> wrote:
>
>> Hello.
>>
>> I am finding it very difficult to install matplotlib with snow
>> leopard. I have the Apple XCODE installed along with numpy (which I
>> have tested and works) and am running the python 2.6 version that
>> comes with the Mac.
>>
>> I have run into the following problems:
>> 1) The diskimage installation: When I open the installer, I am told
>> that I can not install matplotlib on my disk because I do not have a
>> system version of python 2.6. I do not understand this error since I
>> am running the default version (which is 2.6.1).
>>
>> 2) As another person on the list pointed out, easy_install matplotlib
>> tries to install an older version that does not work with the newer
>> version of numpy.
>>
>> 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg. I was able to
>> install matplotlib, seemingly. When I import pylab into python, I do
>> not get any errors. However, I do get an error when I try to plot.
>> With the default backend TkAgg (version 8.5), I get the following
>> error when I try to plot:
>> _tkinter.TclError: integer value too large to represent
>>
>> When I try to change the backend to MacOSX, a window opens labeled
>> Figure 1, but nothing plots. With the verbose level on helpful, I
>> find only that "backend MacOSX version unknown".
>>
>> Has anyone seen any of these problems before and have an idea as to
>> how to fix this? If not, is there another method that I should try
>> (I'm hesitant to try to build/install from the source).
>>
>> Thank you for any help!
>>
>> ------------------------------------------------------------------------------
>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>> a free event focused on virtualization and cloud computing.
>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>> http://p.sf.net/sfu/redhat-sfdev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> <
> make.osx
> >
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: John H. <jd...@gm...> - 2009-12-02 21:26:09
|
On Wed, Dec 2, 2009 at 3:20 PM, Michael Cohen <mc...@ca...> wrote: > Hi, > To add more information. I am trying this on two separate installs of > matplotlib 0.99, both using TkAgg as the backend. One produces an > unreadable file, the other does produce a readable EPS. However, even > in this case, zooming in on the image shows that what is being saved is > bitmapped, not a vector graphic. Could you please post some sample code and the EPS it generates, as well as platform information and any specific rc settings you may have? Thanks, JDH |
|
From: Michael C. <mc...@ca...> - 2009-12-02 21:20:40
|
Hi, To add more information. I am trying this on two separate installs of matplotlib 0.99, both using TkAgg as the backend. One produces an unreadable file, the other does produce a readable EPS. However, even in this case, zooming in on the image shows that what is being saved is bitmapped, not a vector graphic. Cheers Mike Michael Cohen wrote: > Hi all, > I made a typical plot, and tried to save it to EPS. The resulting file > is un-openable in gimp, the gnome thumbnail viewer, evince, and anything > else I have tried. > Is there any problem saving a plot to EPS at the moment? |
|
From: William C. <wcc...@lb...> - 2009-12-02 21:18:02
|
Hi Lisa, I had lots of trouble installing on 10.6 as well. What finally worked for me is to use the (recommended) file make.osx that comes with the matplotlib download. You have to edit that file to point to the versions of Python (you want 2.6) and OSX (you want 10.6). I'm attaching a version that has all these edits already made. (I'm assuming you have an intel Mac, not a ppc). Look at the top of the file and you will see an example command line that begins with PREFIX. You'll execute that command line with the example directory changed to your directory and I highly recommend choosing the directory /Users/(whatever your user name is)/.local All the libraries will be installed there and Python will know how to find them even without explicitly putting them in any PATH variable. This command line will even check for required dependencies like freetype2, pnglib, ... And will go them and install them for you if you don't already have them. The command line should look like: sudo PREFIX=/Users/(your username)/.local make -f make.osx fetch deps mpl_install Good luck, Bill On 12/2/09 12:31 PM, "Lisa M Winter" <Lis...@Co...> wrote: > Hello. > > I am finding it very difficult to install matplotlib with snow > leopard. I have the Apple XCODE installed along with numpy (which I > have tested and works) and am running the python 2.6 version that > comes with the Mac. > > I have run into the following problems: > 1) The diskimage installation: When I open the installer, I am told > that I can not install matplotlib on my disk because I do not have a > system version of python 2.6. I do not understand this error since I > am running the default version (which is 2.6.1). > > 2) As another person on the list pointed out, easy_install matplotlib > tries to install an older version that does not work with the newer > version of numpy. > > 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg. I was able to > install matplotlib, seemingly. When I import pylab into python, I do > not get any errors. However, I do get an error when I try to plot. > With the default backend TkAgg (version 8.5), I get the following > error when I try to plot: > _tkinter.TclError: integer value too large to represent > > When I try to change the backend to MacOSX, a window opens labeled > Figure 1, but nothing plots. With the verbose level on helpful, I > find only that "backend MacOSX version unknown". > > Has anyone seen any of these problems before and have an idea as to > how to fix this? If not, is there another method that I should try > (I'm hesitant to try to build/install from the source). > > Thank you for any help! > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Michael C. <mc...@ca...> - 2009-12-02 20:58:53
|
Hi all, I made a typical plot, and tried to save it to EPS. The resulting file is un-openable in gimp, the gnome thumbnail viewer, evince, and anything else I have tried. Is there any problem saving a plot to EPS at the moment? Cheers Mike |
|
From: Tony S Yu <ts...@gm...> - 2009-12-02 20:54:03
|
Hi,
I'm having hard time understanding some of the differences between functions used to plot color patches (not sure what to call them).
I'm trying to fill a curve with a nonuniform color patch (like fill or fill_between but the color in the patch varies). I've attached code that almost does what I want; my question concerns the color patch (which is created by the call to plt.pcolor in the code below). I'd like to have nonuniform grid spacing in the color values, and also shading (i.e. interpolation of color between points). Here's what I understand:
pcolor: allows nonuniform grid spacing, but it doesn't do shading.
imshow: allows color shading, but requires uniform spacing
pcolormesh: allows color interpolation and nonuniform grid spacing
pcolormesh seems like the ideal candidate, but when I replace pcolor with pcolormesh (code commented out below pcolor call), the path doesn't get clipped by set_clip_path (but no errors are raised); in other words, the color shading fills the entire plot area. Is this a bug?
Is there a way of making this plot work that I've overlooked?
Thanks!
-Tony
#~~~~ example code
import matplotlib.pyplot as plt
import numpy as np
def plot_filled_curve(x, y, c):
"""Plot curve filled with color patch
Parameters
----------
x, y : arrays
points describing curve
c : array
value of describing color gradient filling the curve. Must match the
lengths of `x` and `y`.
"""
# add end points so that fill extends to the x-axis
x_closed = np.concatenate([x[:1], x, x[-1:]])
y_closed = np.concatenate([[0], y, [0]])
# fill between doesn't work here b/c it returns a PolyCollection, plus it
# adds the lower half of the plot by adding a Rect with a border
patch, = plt.fill(x_closed, y_closed, facecolor='none')
X, Y = np.meshgrid(x, [0, y.max()])
# take average since C specifies color in between X, Y points
C = [((c[:-1] + c[1:]) / 2.)]
im = plt.pcolor(X, Y, C, cmap=plt.cm.gray, vmin=0, vmax=1)
# C = np.vstack((c, c))
# im = plt.pcolormesh(X, Y, C,
# cmap=plt.cm.gray, vmin=0, vmax=1, shading='gouraud')
im.set_clip_path(patch)
if __name__ == '__main__':
x0 = .45
x = np.linspace(0, 1, 11)
x = np.insert(x, (5, 5), (x0,)*2)
y = np.hstack(([2]*7, 2*np.linspace(0.9, 0, 6)**2))
c = np.hstack(([0]*6, [1], np.linspace(0.9,0,6)))
plot_filled_curve(x, y, c)
plt.show()
|
|
From: Lisa M W. <Lis...@Co...> - 2009-12-02 20:31:31
|
Hello. I am finding it very difficult to install matplotlib with snow leopard. I have the Apple XCODE installed along with numpy (which I have tested and works) and am running the python 2.6 version that comes with the Mac. I have run into the following problems: 1) The diskimage installation: When I open the installer, I am told that I can not install matplotlib on my disk because I do not have a system version of python 2.6. I do not understand this error since I am running the default version (which is 2.6.1). 2) As another person on the list pointed out, easy_install matplotlib tries to install an older version that does not work with the newer version of numpy. 3) I downloaded the matplotlib-0.99.1.1-py2.6 egg. I was able to install matplotlib, seemingly. When I import pylab into python, I do not get any errors. However, I do get an error when I try to plot. With the default backend TkAgg (version 8.5), I get the following error when I try to plot: _tkinter.TclError: integer value too large to represent When I try to change the backend to MacOSX, a window opens labeled Figure 1, but nothing plots. With the verbose level on helpful, I find only that "backend MacOSX version unknown". Has anyone seen any of these problems before and have an idea as to how to fix this? If not, is there another method that I should try (I'm hesitant to try to build/install from the source). Thank you for any help! |
|
From: Ryan N. <rya...@gm...> - 2009-12-02 19:18:44
|
Hello,
I'm trying to use AxesGrid but I'm running into a problem:
I can plot a single pcolor plot:
[image: 58dFK.png]
But when I try to use AxesGrid, my pcolor plot is ending up where I expect
my colorbar to be.
[image: mEbTA.png]
I want to have up to 6 of these plots stacked vertically, sharing a common
time axis and y (depth) scale.
I'll try to simplify my code to show what I'm doing:
# I have arrays x_grid and y_grid for time and water depth.
# z_dim is a dictionary of arrays (one for each plot)
# In the plot above it has two arrays.
from matplotlib import pyplot
nrows = len(z_dim) # Number of rows is the number of arrays
My_figure = pyplot.figure(1,(8,8))
my_grid = AxesGrid(My_figure, 111, #Is this always 111?
nrows_ncols = (nrows,1), # Always one column
axes_pad = 0.1,
add_all=True,
share_all=True, # They all share the same time and depth
scales
label_mode = "L",
cbar_location="right",
cbar_mode="each",
cbar_size="7%",
cbar_pad="2%",
)
for row_no,parameter in enumerate(z_dim):
ax = my_grid[row_no]
ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
pyplot.draw()
pyplot.show()
I eventually want to end up with something like this matlab output (which I
didn't generate):
[image: jiIaK.png]
but without the duplication of x scales.
I'm new to pyplot and even after reading the documentation much of this is
baffling.
-Ryan
|