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
(10) |
2
(3) |
3
(5) |
4
(7) |
5
(18) |
6
(4) |
7
(15) |
8
(7) |
9
(10) |
10
(4) |
11
(18) |
12
(15) |
13
(11) |
14
(11) |
15
(4) |
16
(28) |
17
(17) |
18
(22) |
19
(12) |
20
(19) |
21
(17) |
22
(14) |
23
(4) |
24
(3) |
25
(6) |
26
(8) |
27
(13) |
28
(11) |
29
(21) |
30
(3) |
31
(5) |
|
|
|
|
|
|
>> On 2006年12月22日, ch...@se... apparently wrote:=20 >>> 1st message in this thread has code to create each plot.=20 >>> Each one does a 'figure_ =3D pylab.figure()' already.=20 > Alan G Isaac wrote:=20 >> Sorry I missed the thread, but each call to pylab.figure()=20 >> will give you a new active figure. Everything you plot will=20 >> then be plotted to that figure. Previous plots will not be=20 >> erased until you explicitly remove them. You can also get=20 >> the axes for a particular figure and plot directly to the=20 >> axis.=20 >> Probably you are not creating new figures when you think you=20 >> are...=20 On 2006年12月22日, Eric Firing apparently wrote:=20 > I'm puzzled. The call to pylab.close() after the savefig should=20 > completely wipe out the current figure, shouldn't it?=20 Just because the figure window is closed does not mean the figure is deleted. Chris apparently maintains a reference to the figure? > And even without the close (which certainly should be used anyway), each= =20 > function starts with a call to pylab.figure() which should start a new=20 > figure.=20 Right! This my comment above. Cheers, Alan Isaac
Alan G Isaac wrote: > On 2006年12月22日, ch...@se... apparently wrote: >> 1st message in this thread has code to create each plot. >> Each one does a 'figure_ = pylab.figure()' already. > > Sorry I missed the thread, but each call to pylab.figure() > will give you a new active figure. Everything you plot will > then be plotted to that figure. Previous plots will not be > erased until you explicitly remove them. You can also get > the axes for a particular figure and plot directly to the > axis. > > Probably you are not creating new figures when you think you > are... I'm puzzled. The call to pylab.close() after the savefig should completely wipe out the current figure, shouldn't it? And even without the close (which certainly should be used anyway), each function starts with a call to pylab.figure() which should start a *new* figure. I can't look into it now, though. Eric > > hth, > Alan Isaac
On 2006年12月22日, ch...@se... apparently wrote:=20 > 1st message in this thread has code to create each plot. =20 > Each one does a 'figure_ =3D pylab.figure()' already.=20 Sorry I missed the thread, but each call to pylab.figure()=20 will give you a new active figure. Everything you plot will=20 then be plotted to that figure. Previous plots will not be=20 erased until you explicitly remove them. You can also get=20 the axes for a particular figure and plot directly to the=20 axis. Probably you are not creating new figures when you think you=20 are... hth, Alan Isaac
On Fri, Dec 22, 2006 at 12:21:44PM -0500, Alan G Isaac wrote: > On 2006年12月22日, ch...@se... apparently wrote: > > I'm wondering if there is some way to tell Maplotlib to > > create a DIFFERENT figure > > It looks like you are using pylab? > How about pylab.figure()? > Thanks for email. Yes 1st message in this thread has code to create each plot. Each one does a 'figure_ = pylab.figure()' already. chris
On 2006年12月22日, ch...@se... apparently wrote:=20 > I'm wondering if there is some way to tell Maplotlib to=20 > create a DIFFERENT figure=20 It looks like you are using pylab? How about pylab.figure()? Cheers, Alan Isaac
On Thu, Dec 21, 2006 at 10:16:25PM -1000, Eric Firing wrote: > Try putting > > pylab.close() > > after each pylab.savefig() Thanks for the email. That didn't fix it for some reason. Any else I'm missing? I'm wondering if there is some way to tell Maplotlib to create a DIFFERENT figure rather than mixing them all together. Chris
Hello, I would like to change the axes box by two arrows in the x and y direction, something like this: y ^ | | | | +------------>x Can it be done in matplotlib?
Hello, I have installed matplotlib 0.87.7 (with the standard windows exe). If I use the provided matplotlibrc file I get errors complaining about the following lines: lines.markerfacecolor : blue lines.markeredgecolor : black Commenting them out stops the problem and matplotlib seems to run fine. Am I the only one getting this errors? Is this already known? Should I worry about it?
Try putting pylab.close() after each pylab.savefig() Eric ch...@se... wrote: > Help! I'm trying to make multiple plots in a web app and old plots seem to > stick around and show up on new plots!??! > > Is there someway to "erase the canvas" or avoid this happening? > > Sound familiar? > > growth function below is the first plot that is ok. > management function below is the one that has growth plot in it. > > Chris > > ===================================================================== > > import matplotlib > matplotlib.use("Agg") > import pylab > > BACKGROUND_COLOR = "#ffffff" > > def growth(company): > """ > Plots Growth plot. > """ > > # Generates figure_, plot_ and functions. > > figure_ = pylab.figure() > plot_ = pylab.subplot(111, axisbg=BACKGROUND_COLOR) > years_plus_5 = company.years + range(max(company.years) + 1, > max(company.years) + 6) > five_percent = [1.05 ** (y - min(company.years)) > for y in years_plus_5] > ten_percent = [1.10 ** (y - min(company.years)) > for y in years_plus_5] > fifteen_percent = [1.15 ** (y - min(company.years)) > for y in years_plus_5] > twenty_percent = [1.20 ** (y - min(company.years)) > for y in years_plus_5] > twenty_five_percent = [1.25 ** (y - min(company.years)) > for y in years_plus_5] > thirty_percent = [1.30 ** (y - min(company.years)) > for y in years_plus_5] > scaled_sales = [50.0 * e / company.sales[-1] > for e in company.sales] > scaled_earnings = [30.0 * e / company.earnings[-1] > for e in company.earnings] > scaled_pretax_profit = [10.0 * e / company.pretax_profit[-1] > for e in company.pretax_profit] > scaled_low_price = [100.0 * e / company.high_price[-1] > for e in company.low_price] > scaled_high_price = [100.0 * e / company.high_price[-1] > for e in company.high_price] > functions = plot_.semilogy(company.years, scaled_sales, > company.years, scaled_earnings, > company.years, scaled_pretax_profit, > years_plus_5, five_percent, > years_plus_5, ten_percent, > years_plus_5, fifteen_percent, > years_plus_5, twenty_percent, > years_plus_5, twenty_five_percent, > years_plus_5, thirty_percent) > > # Adds price bars and sets their thickness. > > offset = 0.12 > for i, y in enumerate(company.years): > plot_.semilogy((y, y), > (scaled_low_price[i], scaled_high_price[i]), > linewidth="2.2", color = "black", zorder = 1) > plot_.semilogy((y - offset, y + offset), > (scaled_low_price[i], scaled_low_price[i]), > linewidth="2.2", color = "black", zorder = 1) > plot_.semilogy((y - offset, y + offset), > (scaled_high_price[i], scaled_high_price[i]), > linewidth="2.2", color = "black", zorder = 1) > > # Adds sales, earnings and pretax_profit points. > > points = [] > points.append(pylab.scatter(company.years, scaled_sales, 200, > c = BACKGROUND_COLOR)) > points.append(pylab.scatter(company.years, scaled_earnings, 200, > c = BACKGROUND_COLOR)) > points.append(pylab.scatter(company.years, scaled_pretax_profit, 200, > c = BACKGROUND_COLOR)) > > # Configures points. > > pylab.setp(points[0], linewidth = "1.3", edgecolor = "g", zorder = 12) > pylab.setp(points[1], linewidth = "1.3", edgecolor = "b", zorder = 11) > pylab.setp(points[2], linewidth = "1.3", edgecolor = "r", zorder = 10) > > # Configures earnings, sales and pretax_profit. > > pylab.setp(functions[0], linewidth = "3.0", color = "g", zorder = 9) > pylab.setp(functions[1], linewidth = "3.0", color = "b", zorder = 8) > pylab.setp(functions[2], linewidth = "3.0", color = "r", zorder = 7) > > # Configures percentage growth. > > for f in functions[-6:]: > pylab.setp(f, linewidth = "0.5", color = "k", zorder = 5) > > # Configures grid. > > plot_.grid(True) > grid_ = plot_.get_xgridlines() + plot_.get_ygridlines() > pylab.setp(grid_, linestyle = "-", color = "k", linewidth = "0.5", > zorder = 5) > plot_.set_axisbelow(True) > > # Sets view range for both axes. > > pylab.axis([min(company.years), max(company.years) + 5, 1, 200]) > > # Specifies tick values, color, size and boldness. > > x_tick_values = years_plus_5 > x_tick_labels = len(x_tick_values) * [""] > for i in range(1, len(x_tick_values), 2): > x_tick_labels[i] = str(x_tick_values[i]) > pylab.xticks(x_tick_values, x_tick_labels, > color = "k", fontsize = 15, fontweight = "bold") > y_tick_values = range(1, 11, 1) + range(10, 110, 10) + [200] > y_tick_labels = len(y_tick_values) * [""] > for e in [1, 5, 10, 50, 100, 200]: > y_tick_labels[y_tick_values.index(e)] = str(e) > pylab.yticks(y_tick_values, y_tick_labels, > color = "k", fontsize = 15, fontweight = "bold") > > # Adds labels for percentage growth lines. > > pylab.text(max(years_plus_5), 2.0, " 5%", fontsize = 15) > pylab.text(max(years_plus_5), 3.8, " 10%", fontsize = 15) > pylab.text(max(years_plus_5), 7.0, " 15%", fontsize = 15) > pylab.text(max(years_plus_5), 13.0, " 20%", fontsize = 15) > pylab.text(max(years_plus_5), 23.0, " 25%", fontsize = 15) > pylab.text(max(years_plus_5), 40.0, " 30%", fontsize = 15) > > # Adds labels for earnings, sales and pretax profit points. > > for c in zip(company.years, scaled_sales): > pylab.text(c[0], c[1], "S", > horizontalalignment = 'center', > verticalalignment = 'center', > color = "g", > clip_on = True, > zorder = 12, > fontweight = "bold", > fontsize = 15) > for c in zip(company.years, scaled_earnings): > pylab.text(c[0], c[1], "E", > horizontalalignment = 'center', > verticalalignment = 'center', > color = "b", > clip_on = True, > zorder = 11, > fontweight = "bold", > fontsize = 15) > for c in zip(company.years, scaled_pretax_profit): > pylab.text(c[0], c[1], "P", > horizontalalignment = 'center', > verticalalignment = 'center', > color = "r", > clip_on = True, > zorder = 10, > fontweight = "bold", > fontsize = 15) > > # Sets background of figure to be transparent. > > figure_.figurePatch.set_alpha(0.0) > > # Creates a PNG file. > > pylab.savefig("gnustocks/static/images/growth_plot.png", dpi = (100)) > > def management(company): > figure_ = pylab.figure() > > t = pylab.arange(0.0, 2.0, 0.01) > import math > s = pylab.sin(2*math.pi*t) > pylab.plot(t, s, linewidth=1.0) > > pylab.xlabel('time (s)') > pylab.ylabel('voltage (mV)') > pylab.title('About as simple as it gets, folks') > pylab.grid(True) > pylab.savefig("gnustocks/static/images/management.png", dpi = (100)) > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
The solution is to uninstall the deb package and install an up-to-date matplotlib. Whether there is a deb package somewhere that will work on debian stable, I don't know, but installing from the tarball is easy if you have the necessary devel packages installed. Eric Thierry Dumont wrote: > I have a problem on my debian stable installation. > > I use the packages of altervista: > deb http://anakonda.altervista.org/debian packages/ > deb-src http://anakonda.altervista.org/debian sources/ > > subplot is ok with the syntax subplot(212) for example, but not with > subplot(2,1,2) (and I need this syntax). > > In the second case, all the plots appears at the same place. > To see this, simply change the subblot commands in zorder_demo.py for > example. > > With an Ubuntu installation (6.10) (in this case matplotlib is packaged > in the distribution), it seems ok. > > any solution? > > t.d. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
I have a problem on my debian stable installation. I use the packages of altervista: deb http://anakonda.altervista.org/debian packages/ deb-src http://anakonda.altervista.org/debian sources/ subplot is ok with the syntax subplot(212) for example, but not with subplot(2,1,2) (and I need this syntax). In the second case, all the plots appears at the same place. To see this, simply change the subblot commands in zorder_demo.py for example. With an Ubuntu installation (6.10) (in this case matplotlib is packaged in the distribution), it seems ok. any solution? t.d. -- Thierry Dumont. Institut Camille Jordan -- Mathematiques-- Univ. Lyon I,43 Bd du 11 Novembre 1918, 69622 - Villeurbanne Cedex - France. td...@ma... web: http://math.univ-lyon1.fr/~tdumont
Help! I'm trying to make multiple plots in a web app and old plots seem to stick around and show up on new plots!??! Is there someway to "erase the canvas" or avoid this happening? Sound familiar? growth function below is the first plot that is ok. management function below is the one that has growth plot in it. Chris ===================================================================== import matplotlib matplotlib.use("Agg") import pylab BACKGROUND_COLOR = "#ffffff" def growth(company): """ Plots Growth plot. """ # Generates figure_, plot_ and functions. figure_ = pylab.figure() plot_ = pylab.subplot(111, axisbg=BACKGROUND_COLOR) years_plus_5 = company.years + range(max(company.years) + 1, max(company.years) + 6) five_percent = [1.05 ** (y - min(company.years)) for y in years_plus_5] ten_percent = [1.10 ** (y - min(company.years)) for y in years_plus_5] fifteen_percent = [1.15 ** (y - min(company.years)) for y in years_plus_5] twenty_percent = [1.20 ** (y - min(company.years)) for y in years_plus_5] twenty_five_percent = [1.25 ** (y - min(company.years)) for y in years_plus_5] thirty_percent = [1.30 ** (y - min(company.years)) for y in years_plus_5] scaled_sales = [50.0 * e / company.sales[-1] for e in company.sales] scaled_earnings = [30.0 * e / company.earnings[-1] for e in company.earnings] scaled_pretax_profit = [10.0 * e / company.pretax_profit[-1] for e in company.pretax_profit] scaled_low_price = [100.0 * e / company.high_price[-1] for e in company.low_price] scaled_high_price = [100.0 * e / company.high_price[-1] for e in company.high_price] functions = plot_.semilogy(company.years, scaled_sales, company.years, scaled_earnings, company.years, scaled_pretax_profit, years_plus_5, five_percent, years_plus_5, ten_percent, years_plus_5, fifteen_percent, years_plus_5, twenty_percent, years_plus_5, twenty_five_percent, years_plus_5, thirty_percent) # Adds price bars and sets their thickness. offset = 0.12 for i, y in enumerate(company.years): plot_.semilogy((y, y), (scaled_low_price[i], scaled_high_price[i]), linewidth="2.2", color = "black", zorder = 1) plot_.semilogy((y - offset, y + offset), (scaled_low_price[i], scaled_low_price[i]), linewidth="2.2", color = "black", zorder = 1) plot_.semilogy((y - offset, y + offset), (scaled_high_price[i], scaled_high_price[i]), linewidth="2.2", color = "black", zorder = 1) # Adds sales, earnings and pretax_profit points. points = [] points.append(pylab.scatter(company.years, scaled_sales, 200, c = BACKGROUND_COLOR)) points.append(pylab.scatter(company.years, scaled_earnings, 200, c = BACKGROUND_COLOR)) points.append(pylab.scatter(company.years, scaled_pretax_profit, 200, c = BACKGROUND_COLOR)) # Configures points. pylab.setp(points[0], linewidth = "1.3", edgecolor = "g", zorder = 12) pylab.setp(points[1], linewidth = "1.3", edgecolor = "b", zorder = 11) pylab.setp(points[2], linewidth = "1.3", edgecolor = "r", zorder = 10) # Configures earnings, sales and pretax_profit. pylab.setp(functions[0], linewidth = "3.0", color = "g", zorder = 9) pylab.setp(functions[1], linewidth = "3.0", color = "b", zorder = 8) pylab.setp(functions[2], linewidth = "3.0", color = "r", zorder = 7) # Configures percentage growth. for f in functions[-6:]: pylab.setp(f, linewidth = "0.5", color = "k", zorder = 5) # Configures grid. plot_.grid(True) grid_ = plot_.get_xgridlines() + plot_.get_ygridlines() pylab.setp(grid_, linestyle = "-", color = "k", linewidth = "0.5", zorder = 5) plot_.set_axisbelow(True) # Sets view range for both axes. pylab.axis([min(company.years), max(company.years) + 5, 1, 200]) # Specifies tick values, color, size and boldness. x_tick_values = years_plus_5 x_tick_labels = len(x_tick_values) * [""] for i in range(1, len(x_tick_values), 2): x_tick_labels[i] = str(x_tick_values[i]) pylab.xticks(x_tick_values, x_tick_labels, color = "k", fontsize = 15, fontweight = "bold") y_tick_values = range(1, 11, 1) + range(10, 110, 10) + [200] y_tick_labels = len(y_tick_values) * [""] for e in [1, 5, 10, 50, 100, 200]: y_tick_labels[y_tick_values.index(e)] = str(e) pylab.yticks(y_tick_values, y_tick_labels, color = "k", fontsize = 15, fontweight = "bold") # Adds labels for percentage growth lines. pylab.text(max(years_plus_5), 2.0, " 5%", fontsize = 15) pylab.text(max(years_plus_5), 3.8, " 10%", fontsize = 15) pylab.text(max(years_plus_5), 7.0, " 15%", fontsize = 15) pylab.text(max(years_plus_5), 13.0, " 20%", fontsize = 15) pylab.text(max(years_plus_5), 23.0, " 25%", fontsize = 15) pylab.text(max(years_plus_5), 40.0, " 30%", fontsize = 15) # Adds labels for earnings, sales and pretax profit points. for c in zip(company.years, scaled_sales): pylab.text(c[0], c[1], "S", horizontalalignment = 'center', verticalalignment = 'center', color = "g", clip_on = True, zorder = 12, fontweight = "bold", fontsize = 15) for c in zip(company.years, scaled_earnings): pylab.text(c[0], c[1], "E", horizontalalignment = 'center', verticalalignment = 'center', color = "b", clip_on = True, zorder = 11, fontweight = "bold", fontsize = 15) for c in zip(company.years, scaled_pretax_profit): pylab.text(c[0], c[1], "P", horizontalalignment = 'center', verticalalignment = 'center', color = "r", clip_on = True, zorder = 10, fontweight = "bold", fontsize = 15) # Sets background of figure to be transparent. figure_.figurePatch.set_alpha(0.0) # Creates a PNG file. pylab.savefig("gnustocks/static/images/growth_plot.png", dpi = (100)) def management(company): figure_ = pylab.figure() t = pylab.arange(0.0, 2.0, 0.01) import math s = pylab.sin(2*math.pi*t) pylab.plot(t, s, linewidth=1.0) pylab.xlabel('time (s)') pylab.ylabel('voltage (mV)') pylab.title('About as simple as it gets, folks') pylab.grid(True) pylab.savefig("gnustocks/static/images/management.png", dpi = (100))
Adding the line numeric: numpy to my matplotlibrc file fixed the problem. Thanks, Paul Darren Dale wrote: > On Thursday 21 December 2006 13:43, Jeff Whitaker wrote: >> Paul Novak wrote: >>> I have a problem that arose when I tried to run the gridding irregularly >>> spaced data demo on the wiki >>> http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data >>> >>> When I run the attached script, which sets one value of an array to >>> nan, masks the array where there are nan, and tries to plot it using >>> contour(), I get the following errors: >>> >>> /usr/lib/python2.4/site-packages/numpy/core/ma.py:604: UserWarning: >>> Cannot automatically convert masked array to numeric because data >>> is masked in one or more locations. >>> warnings.warn("Cannot automatically convert masked array to "\ >>> Traceback (most recent call last): >>> File "masked_nan.py", line 18, in ? >>> contour(x, y, z) >>> File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line >>> 1754, in contour >>> ret = gca().contour(*args, **kwargs) >>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line >>> 4092, in contour >>> return ContourSet(self, *args, **kwargs) >>> File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line >>> 429, in __init__ >>> x, y, z = self._contour_args(*args) # also sets self.levels, >>> File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line >>> 614, in _contour_args >>> lev = self._autolev(z, 7) >>> File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line >>> 517, in _autolev >>> zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin) >>> TypeError: unsupported operand type(s) for -: 'str' and 'str' >>> >>> I am using >>> >>>>>> numpy.__version__ >>> '1.0' >>> >>>>>> matplotlib.__version__ >>> '0.87.7' >>> >>> Is there a way to use contour() and plot arrays whose elements may be >>> nan? >>> >>> Thanks, >>> Paul >> Paul: Your test script works for me (numpy 1.0, matplotlib 0.87.7, >> python2.5 on macos x). > > It worked fine for me too. Do you happen to have numerix : Numeric in your > matplotlibrc file? > > Darren > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
On Thursday 21 December 2006 13:43, Jeff Whitaker wrote: > Paul Novak wrote: > > I have a problem that arose when I tried to run the gridding irregularly > > spaced data demo on the wiki > > http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data > > > > When I run the attached script, which sets one value of an array to > > nan, masks the array where there are nan, and tries to plot it using > > contour(), I get the following errors: > > > > /usr/lib/python2.4/site-packages/numpy/core/ma.py:604: UserWarning: > > Cannot automatically convert masked array to numeric because data > > is masked in one or more locations. > > warnings.warn("Cannot automatically convert masked array to "\ > > Traceback (most recent call last): > > File "masked_nan.py", line 18, in ? > > contour(x, y, z) > > File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line > > 1754, in contour > > ret = gca().contour(*args, **kwargs) > > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line > > 4092, in contour > > return ContourSet(self, *args, **kwargs) > > File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line > > 429, in __init__ > > x, y, z = self._contour_args(*args) # also sets self.levels, > > File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line > > 614, in _contour_args > > lev = self._autolev(z, 7) > > File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line > > 517, in _autolev > > zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin) > > TypeError: unsupported operand type(s) for -: 'str' and 'str' > > > > I am using > > > > >>> numpy.__version__ > > > > '1.0' > > > > >>> matplotlib.__version__ > > > > '0.87.7' > > > > Is there a way to use contour() and plot arrays whose elements may be > > nan? > > > > Thanks, > > Paul > > Paul: Your test script works for me (numpy 1.0, matplotlib 0.87.7, > python2.5 on macos x). It worked fine for me too. Do you happen to have numerix : Numeric in your matplotlibrc file? Darren
Paul Novak wrote: > I have a problem that arose when I tried to run the gridding irregularly > spaced data demo on the wiki > http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data > > When I run the attached script, which sets one value of an array to > nan, masks the array where there are nan, and tries to plot it using > contour(), I get the following errors: > > /usr/lib/python2.4/site-packages/numpy/core/ma.py:604: UserWarning: > Cannot automatically convert masked array to numeric because data > is masked in one or more locations. > warnings.warn("Cannot automatically convert masked array to "\ > Traceback (most recent call last): > File "masked_nan.py", line 18, in ? > contour(x, y, z) > File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line > 1754, in contour > ret = gca().contour(*args, **kwargs) > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line > 4092, in contour > return ContourSet(self, *args, **kwargs) > File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line > 429, in __init__ > x, y, z = self._contour_args(*args) # also sets self.levels, > File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line > 614, in _contour_args > lev = self._autolev(z, 7) > File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line > 517, in _autolev > zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin) > TypeError: unsupported operand type(s) for -: 'str' and 'str' > > I am using > >>> numpy.__version__ > '1.0' > >>> matplotlib.__version__ > '0.87.7' > > Is there a way to use contour() and plot arrays whose elements may be > nan? > > Thanks, > Paul Paul: Your test script works for me (numpy 1.0, matplotlib 0.87.7, python2.5 on macos x). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328
I have a problem that arose when I tried to run the gridding irregularly spaced data demo on the wiki http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data When I run the attached script, which sets one value of an array to nan, masks the array where there are nan, and tries to plot it using contour(), I get the following errors: /usr/lib/python2.4/site-packages/numpy/core/ma.py:604: UserWarning: Cannot automatically convert masked array to numeric because data is masked in one or more locations. warnings.warn("Cannot automatically convert masked array to "\ Traceback (most recent call last): File "masked_nan.py", line 18, in ? contour(x, y, z) File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 1754, in contour ret = gca().contour(*args, **kwargs) File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 4092, in contour return ContourSet(self, *args, **kwargs) File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 429, in __init__ x, y, z = self._contour_args(*args) # also sets self.levels, File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 614, in _contour_args lev = self._autolev(z, 7) File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 517, in _autolev zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin) TypeError: unsupported operand type(s) for -: 'str' and 'str' I am using >>> numpy.__version__ '1.0' >>> matplotlib.__version__ '0.87.7' Is there a way to use contour() and plot arrays whose elements may be nan? Thanks, Paul
I don't know if this is right place to post this, but there are several missing links on the matplotlib website. For example, all the links from the http://matplotlib.sourceforge.net/matplotlib.numerix.html page are missing. Those links include http://matplotlib.sourceforge.net/matplotlib.numerix.linear_algebra.html http://matplotlib.sourceforge.net/matplotlib.numerix.ma.html among others. Thanks, Paul
Hi, I've been using matplotlib for 2D graphing since two years. Data (3D array) is created with a Fortran program and ploted using imshow() at a particular plane. 3D data is created at each time iteration and saved in a file. For the plotting part, a first imshow() is called with zero values to create the graph and some text is displayed to describe the graph. Then the python script read the 3D data and update the graphic using set_data(). That way, only the "background" image is updated and not the entire graph, resulting in a faster drawing. At each iteration, a png is saved, giving the possibility to create a movie of the time evolution. I would like now to replace the 2D imshow() with the 3D surface_plot(). Saddly, I cannot find a 3D equivalent to set_data(). I get the following error : > Traceback (most recent call last): > File "./src/affichage/affichage_3DE.py", line 450, in updatefig > im_ez.set_data(Z) > File "/usr/lib/python2.4/site-packages/matplotlib/art3d.py", line 47, in __getattr__ > return getattr(self.__dict__['_wrapped'], k) > AttributeError: PolyCollection instance has no attribute 'set_data' So my question is: Is there a equivalent of set_data() for surface_plot()? Thank you very much. Nicolas
John Hunter wrote: >>>>>> "Paul" == Paul Cristini <pau...@un...> writes: >>>>>> > > Paul> Hi everybody, I am trying to perform interpolation on 2d > Paul> data ( irregular or not) and I am wondering if there is a > Paul> way to get the interpolated results which are obtained with > Paul> the imshow command. This would allow a very complete > Paul> interpolation command with many options. The available > Paul> functions ( griddata, interp2d..) only provides few > Paul> possibilities for the interpolation process. > > They are not readily exposed (but with a little work can be accessed > using the existing framework) but I could write some helper methods to > make them more easily usable. > > What are your typical use cases. You do want to turn 2D grayscale > into interpolated 2D grayscale, or 2D->interpolated RGB[A] or RGBA -> > interpolated RGBA? > > The 2nd and 3rd cases can mostly be done with the existing tools, > though some helper methods would facilitate it. > > JDH > There's also the scipy.ndimage (http://www.scipy.org/SciPyPackages/Ndimage - see the Interpolate section). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328
Hi there, I'm new to matplotlib...here is the problem, probably trivial: I've 44 figures handles, and I want to show 1 only, how can I set show() to display one of this instances? if I call show() it opens all the 44 figures. I'm using matplotlib 0.87.7 on ipython 0.7.1 under ubuntu dapper thanks a
>>>>> "Paul" == Paul Cristini <pau...@un...> writes: Paul> Hi everybody, I am trying to perform interpolation on 2d Paul> data ( irregular or not) and I am wondering if there is a Paul> way to get the interpolated results which are obtained with Paul> the imshow command. This would allow a very complete Paul> interpolation command with many options. The available Paul> functions ( griddata, interp2d..) only provides few Paul> possibilities for the interpolation process. They are not readily exposed (but with a little work can be accessed using the existing framework) but I could write some helper methods to make them more easily usable. What are your typical use cases. You do want to turn 2D grayscale into interpolated 2D grayscale, or 2D->interpolated RGB[A] or RGBA -> interpolated RGBA? The 2nd and 3rd cases can mostly be done with the existing tools, though some helper methods would facilitate it. JDH
On Thursday 21 December 2006 08:16, Giorgio Luciano wrote: > I've created a shortcut in the desktop to start idle-n > unsing C:\Python25\Lib\idlelib\idle.bat -n > then I changed matplotlibrc and set interactive: True > then started Idle, loaded the module and run. > At first I had this error message... > > Traceback (most recent call last): > =A0 File "C:\Python25\Lib\site-packages\prove\demo.py", line 1, in <modul= e> > =A0 =A0 from pylab import * > =A0 File "C:\Python25\lib\site-packages\pylab.py", line 1, in <module> > =A0 =A0 from matplotlib.pylab import * > =A0 File "C:\Python25\lib\site-packages\matplotlib\pylab.py", line 220, in > <module> > =A0 =A0 new_figure_manager, draw_if_interactive, show =3D pylab_setup() > =A0 File "C:\Python25\lib\site-packages\matplotlib\backends\__init__.py", > line 23, in pylab_setup > =A0 =A0 globals(),locals(),[backend_name]) > =A0 File > "C:\Python25\lib\site-packages\matplotlib\backends\backend_wxagg.py", > line 19, in <module> > =A0 =A0 import wx > ImportError: No module named wx > > naturally I installed WX wxPython2.8-win32-unicode-2.8.0.1-py25 > > and restart the demo. plots load faster (and I needed to use show). but > then I recalculated and restart and everything crashed again :( > I'm frustrated .. any hints :( > And sorry for bother I dont' want to get back to matlab I see. When you use idle, you should set backend : TkAgg in your rc setting= s.=20 The reason for this is discussed in the matplotlib users manual, see=20 http://matplotlib.sourceforge.net/users_guide_0.87.7.pdf. Darren
It worked !!!! I dont' know why , probably i dind't restart correctly after changing config but with the setting you suggest it went fine. THANKS !! You SAVED my DAY !! Giorgio
Giorgio Luciano wrote: > ... when I restart the function ... all plots freeze. can you give an example? In [1]: from pylab import * In [2]: def f(x): ...: return 2*x ...: In [8]: plot f(array(range(10))) ------> plot(f(array(range(10)))) Out[8]: [<matplotlib.lines.Line2D instance at 0x41f41ecc>] In [9]: show ------> show() In [10]: def f(x): ....: return x*x ....: In [11]: plot f(array(range(10))) -------> plot(f(array(range(10)))) Out[11]: [<matplotlib.lines.Line2D instance at 0x43e0ea8c>] In [12]: show -------> show() works here... sebastian.
I've created a shortcut in the desktop to start idle-n unsing C:\Python25\Lib\idlelib\idle.bat -n then I changed matplotlibrc and set interactive: True then started Idle, loaded the module and run. At first I had this error message... Traceback (most recent call last): File "C:\Python25\Lib\site-packages\prove\demo.py", line 1, in <module> from pylab import * File "C:\Python25\lib\site-packages\pylab.py", line 1, in <module> from matplotlib.pylab import * File "C:\Python25\lib\site-packages\matplotlib\pylab.py", line 220, in <module> new_figure_manager, draw_if_interactive, show = pylab_setup() File "C:\Python25\lib\site-packages\matplotlib\backends\__init__.py", line 23, in pylab_setup globals(),locals(),[backend_name]) File "C:\Python25\lib\site-packages\matplotlib\backends\backend_wxagg.py", line 19, in <module> import wx ImportError: No module named wx naturally I installed WX wxPython2.8-win32-unicode-2.8.0.1-py25 and restart the demo. plots load faster (and I needed to use show). but then I recalculated and restart and everything crashed again :( I'm frustrated .. any hints :( And sorry for bother I dont' want to get back to matlab Giorgio