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
(8) |
2
(11) |
3
(4) |
4
(6) |
|
5
(13) |
6
(30) |
7
(21) |
8
(9) |
9
(19) |
10
(4) |
11
(5) |
|
12
(14) |
13
(19) |
14
(22) |
15
(12) |
16
(15) |
17
(14) |
18
(1) |
|
19
(1) |
20
(11) |
21
(9) |
22
(18) |
23
(39) |
24
(12) |
25
(7) |
|
26
(13) |
27
(18) |
28
(3) |
29
(5) |
30
(12) |
31
(10) |
|
|
From: Eric F. <ef...@ha...> - 2008-10-13 19:59:58
|
Michael Lerner wrote: > Hi, > > I'm trying to plot some data where certain values are marked by a > sentinel, as per the Cookbook example: > > http://www.scipy.org/Cookbook/Matplotlib/Plotting_Images_with_Special_Values > > However, that code is fairly old, and doesn't work. A version that > worked as of ~18 months ago was posted to the list: > > http://www.nabble.com/Re:-Trying-p8831162.html > > but it fails when I try to use it with matplotlib 0.98.3 and imshow. > Does anyone have an updated version? > > Thanks, > > -michael > Michael, In the mpl "examples" directory there is a script that might be directly relevant: examples/pylab_examples/image_masked.py Eric |
|
From: Michael L. <mgl...@gm...> - 2008-10-13 19:53:11
|
Hi, I'm trying to plot some data where certain values are marked by a sentinel, as per the Cookbook example: http://www.scipy.org/Cookbook/Matplotlib/Plotting_Images_with_Special_Values However, that code is fairly old, and doesn't work. A version that worked as of ~18 months ago was posted to the list: http://www.nabble.com/Re:-Trying-p8831162.html but it fails when I try to use it with matplotlib 0.98.3 and imshow. Does anyone have an updated version? Thanks, -michael -- Michael Lerner, Ph.D. IRTA Postdoctoral Fellow Laboratory of Computational Biology NIH/NHLBI 5635 Fishers Lane, Room T909, MSC 9314 Rockville, MD 20852 (UPS/FedEx/Reality) Bethesda MD 20892-9314 (USPS) http://www.umich.edu/~mlerner |
|
From: John H. <jd...@gm...> - 2008-10-13 19:32:47
|
On Mon, Oct 13, 2008 at 2:27 PM, Mathew Yeates <my...@jp...> wrote: > Angus pointed out that I need to do > res.fmt_xdata=foo > Duh. I was evaluating foo. > > But this still doesn't work! > The default formatting operation is still called. This is the correct usage -- so if it is not working you need to post a complete example. Perhaps you are not setting the correct Axes instance? JDH |
|
From: Mathew Y. <my...@jp...> - 2008-10-13 19:28:05
|
Angus pointed out that I need to do res.fmt_xdata=foo Duh. I was evaluating foo. But this still doesn't work! The default formatting operation is still called. Mathew Mathew Yeates wrote: > Thanks Angus. I tried this out ... it works once and only once! > BTW, The correct thing to do is > res=fig.gca() > res.fmt_xdata=foo() #instead of format_xdata > res.fmt_ydata=foo() > > although, like I said, it only first for the first event. Somehow > res.fmt_xdata is getting set back to None > > > Mathew > > > Angus McMorland wrote: > >> Hi Mathew, >> >> 2008/10/13 Mathew Yeates <my...@jp... >> <mailto:my...@jp...>> >> >> Okay, I've gotten this far. I have a Figure and I think I can >> change the >> formatting of the values displayed in the toolbar by setting >> taking the >> X axis and setting the function >> format_xdata >> to something of my own (something that computes lat/lon). Similar idea >> for the Y axis. >> >> So, given my figure, how do I get the X and Y axis? All I see is >> gca(). >> But how can I get both? Using fig.get_axes() I only got 1 axis. >> >> >> I think this is a terminology issue: the axis objects returned by >> gca() or in the list returned by get_axes() incorporate both the >> 'axes' in the sense of x and y axes. With the single result of gca() >> you can get at both the x and y axes. For example: >> >> import matplotlib.pyplot as plt >> ax = plt.gca() >> ax.set_xlims(xmin=-1) >> ax.set_ylims(ymax=0) >> ax.format_xdata = ... # if this is how you use this bit - haven't >> needed to change these myself >> ax.format_ydata = ... >> >> I hope that helps, >> >> Angus. >> >> -- >> AJC McMorland >> Post-doctoral research fellow >> Neurobiology, University of Pittsburgh >> > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Angus M. <am...@gm...> - 2008-10-13 19:21:41
|
And forwarded to the list... forgot to hit reply to all. ---------- Forwarded message ---------- From: Angus McMorland <am...@gm...> Date: 2008/10/13 Subject: Re: [Matplotlib-users] how do I get my axis To: Mathew Yeates <my...@jp...> 2008/10/13 Mathew Yeates <my...@jp...> > Thanks Angus. I tried this out ... it works once and only once! > BTW, The correct thing to do is > res=fig.gca() > res.fmt_xdata=foo() #instead of format_xdata > res.fmt_ydata=foo() > I've just dug around in some old code, now that you've shown me this example to jog my memory. Perhaps you want to try res.fmt_xdata=foo (i.e. no brackets, so you pass the function, not the result of the function). Angus. > although, like I said, it only first for the first event. Somehow > res.fmt_xdata is getting set back to None > > > Mathew > > > Angus McMorland wrote: > >> Hi Mathew, >> >> 2008/10/13 Mathew Yeates <my...@jp... <mailto: >> my...@jp...>> >> >> >> Okay, I've gotten this far. I have a Figure and I think I can >> change the >> formatting of the values displayed in the toolbar by setting >> taking the >> X axis and setting the function >> format_xdata >> to something of my own (something that computes lat/lon). Similar idea >> for the Y axis. >> >> So, given my figure, how do I get the X and Y axis? All I see is >> gca(). >> But how can I get both? Using fig.get_axes() I only got 1 axis. >> >> >> I think this is a terminology issue: the axis objects returned by gca() or >> in the list returned by get_axes() incorporate both the 'axes' in the sense >> of x and y axes. With the single result of gca() you can get at both the x >> and y axes. For example: >> >> import matplotlib.pyplot as plt >> ax = plt.gca() >> ax.set_xlims(xmin=-1) >> ax.set_ylims(ymax=0) >> ax.format_xdata = ... # if this is how you use this bit - haven't needed >> to change these myself >> ax.format_ydata = ... >> I hope that helps, >> >> Angus. >> >> -- >> AJC McMorland >> Post-doctoral research fellow >> Neurobiology, University of Pittsburgh >> > > > -- AJC McMorland Post-doctoral research fellow Neurobiology, University of Pittsburgh -- AJC McMorland Post-doctoral research fellow Neurobiology, University of Pittsburgh |
|
From: Mathew Y. <my...@jp...> - 2008-10-13 19:16:09
|
Thanks Angus. I tried this out ... it works once and only once! BTW, The correct thing to do is res=fig.gca() res.fmt_xdata=foo() #instead of format_xdata res.fmt_ydata=foo() although, like I said, it only first for the first event. Somehow res.fmt_xdata is getting set back to None Mathew Angus McMorland wrote: > Hi Mathew, > > 2008/10/13 Mathew Yeates <my...@jp... > <mailto:my...@jp...>> > > Okay, I've gotten this far. I have a Figure and I think I can > change the > formatting of the values displayed in the toolbar by setting > taking the > X axis and setting the function > format_xdata > to something of my own (something that computes lat/lon). Similar idea > for the Y axis. > > So, given my figure, how do I get the X and Y axis? All I see is > gca(). > But how can I get both? Using fig.get_axes() I only got 1 axis. > > > I think this is a terminology issue: the axis objects returned by > gca() or in the list returned by get_axes() incorporate both the > 'axes' in the sense of x and y axes. With the single result of gca() > you can get at both the x and y axes. For example: > > import matplotlib.pyplot as plt > ax = plt.gca() > ax.set_xlims(xmin=-1) > ax.set_ylims(ymax=0) > ax.format_xdata = ... # if this is how you use this bit - haven't > needed to change these myself > ax.format_ydata = ... > > I hope that helps, > > Angus. > > -- > AJC McMorland > Post-doctoral research fellow > Neurobiology, University of Pittsburgh |
|
From: Angus M. <am...@gm...> - 2008-10-13 19:09:08
|
Hi Mathew, 2008/10/13 Mathew Yeates <my...@jp...> > Okay, I've gotten this far. I have a Figure and I think I can change the > formatting of the values displayed in the toolbar by setting taking the > X axis and setting the function > format_xdata > to something of my own (something that computes lat/lon). Similar idea > for the Y axis. > > So, given my figure, how do I get the X and Y axis? All I see is gca(). > But how can I get both? Using fig.get_axes() I only got 1 axis. I think this is a terminology issue: the axis objects returned by gca() or in the list returned by get_axes() incorporate both the 'axes' in the sense of x and y axes. With the single result of gca() you can get at both the x and y axes. For example: import matplotlib.pyplot as plt ax = plt.gca() ax.set_xlims(xmin=-1) ax.set_ylims(ymax=0) ax.format_xdata = ... # if this is how you use this bit - haven't needed to change these myself ax.format_ydata = ... I hope that helps, Angus. -- AJC McMorland Post-doctoral research fellow Neurobiology, University of Pittsburgh |
|
From: Mathew Y. <my...@jp...> - 2008-10-13 18:51:44
|
Okay, I've gotten this far. I have a Figure and I think I can change the formatting of the values displayed in the toolbar by setting taking the X axis and setting the function format_xdata to something of my own (something that computes lat/lon). Similar idea for the Y axis. So, given my figure, how do I get the X and Y axis? All I see is gca(). But how can I get both? Using fig.get_axes() I only got 1 axis. Anybody know? Mathew |
|
From: Mathew Y. <my...@jp...> - 2008-10-13 16:23:45
|
Hi Is there a way to display the latitude and longitude of the cursor when displaying a Basemap? Mathew |
|
From: <ch...@se...> - 2008-10-13 06:01:37
|
LaTeX can accept embedded Python code with a python.sty file. This is handy to dynamically generate plots with Matplotlib for a LaTeX slide presentation. I successfully embedded lots of matplotlib plot code into my slides and then had problems with zorder. For some reason zorder seems to mess up the footer of my Beamer/LaTeX slides. (For some reason zorder setting make the footer shrink in size.) Is there any weirdness or side effects about zorder I should be aware of that would explain this? Chris |
|
From: Eric F. <ef...@ha...> - 2008-10-13 05:03:21
|
Jeff Whitaker wrote: > Ian Curington wrote: >> Does anyone have extensions or hints on how to create high quality >> vector contour plots on unstructured triangle meshes, with values at >> nodes? I can convert to structured with griddata, but I much prefer to >> get a direct contour from the original triangles. Thanks! > Ian: Matplotlib's contour cannot do this (although I believe the > underlying c code does have this capability). I think it would be a Although contouring routines often do subdivide the rectilinear grid into triangles, and use those triangles to calculate the contours, the cntr.c routine in mpl does not. It does everything using only the original rectilinear grid. Eric > useful addition. For right now, however, your workaround is the best > solution. > > PyNGL (http://www.pyngl.ucar.edu/Graphics/contour_grids.shtml) can > contour triangular meshes, if you'd like to give that a try. > > -Jeff > |
|
From: Jesper L. <jes...@gm...> - 2008-10-13 04:48:14
|
Hi Eric and Goyo Thanks for your comments and thanks for your working example, Goyo. Eric Firing <ef...@ha...>: > If you are only using savefig, not plotting to the screen, then you might as > well use the agg backend, not the gtkagg. I have previously used the agg backend without any problems. The reason I am switching to GTK(Agg) is because I would like to save some of my plots in jpeg (which only the GTK backend supports). In some tests that I have made (manually converting png plots to jpeg with PIL) it seems like this will result in much smaller plots that are still in good quality. My application serves plots over the internet so file size is quite important. Best regards, Jesper |
|
From: John H. <jd...@gm...> - 2008-10-13 03:09:02
|
On Sun, Oct 12, 2008 at 9:01 PM, bwgoudey <bwg...@gm...> wrote: > > Hi, > At the moment, I have a graph which has an un labelled x-axis and all i'm > drawing is a filled green rectangle every so often. I would like make it so > that when I zoom in to my graph past a certain threshold, the rectangles > change so that the first half is a different colour to the second half and > the x-axis is now labelled. Does anyone have any suggestions on how I could > implement this? If my explanation hasn't made sense, or lacks details, feel > free to ask for more. the clipped line demo at http://matplotlib.sourceforge.net/examples/pylab_examples/clippedline.py shows how to change properties depending on the zoom level. i doesn't d it *exactly* as you indicate, but you give you enough to go on. JDH |
|
From: bwgoudey <bwg...@gm...> - 2008-10-13 02:01:11
|
Hi, At the moment, I have a graph which has an un labelled x-axis and all i'm drawing is a filled green rectangle every so often. I would like make it so that when I zoom in to my graph past a certain threshold, the rectangles change so that the first half is a different colour to the second half and the x-axis is now labelled. Does anyone have any suggestions on how I could implement this? If my explanation hasn't made sense, or lacks details, feel free to ask for more. Cheers -- View this message in context: http://www.nabble.com/Alter-graph-labels-based-on-zoom-level-tp19947898p19947898.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2008-10-12 23:26:51
|
Goyo wrote:
> El lun, 13-10-2008 a las 00:41 +0200, Goyo escribió:
>
>> But I don't know how to set the dpi value this way. I tried to use the
>> OO API but no success.
>
> Well yes...
>
> import matplotlib
> matplotlib.use('GTKAgg')
> from matplotlib import pyplot
> fig = pyplot.figure(dpi=100)
> ax = fig.add_subplot('111')
> ax.plot([1, 2, 3], [1, 2, 3])
> fig.savefig('test.jpg')
>
> But changing the dpi value has no effect so maybe I'm missing something.
The figure dpi is irrelevant when saving the figure; only the dpi
specified in the savefig command matters for that. This is inherently
confusing. I'm thinking about a solution, but haven't tried it yet.
Eric
|
|
From: Eric F. <ef...@ha...> - 2008-10-12 23:23:13
|
Goyo wrote:
> Hi all,
>
> I'm plotting time series and using a custom format for x tick labels
> because I want to see both date and time. But calling xlim makes the
> default format return -- only dates or only times, it depends on the
> displayed interval.
>
> I can get my preferred format back by calling set_major_formatter again,
> but this is inconvenient for interactive use.
>
> I wonder if there is a better way for changing x limits while keeping
> tick labels format unchanged.
>
> I'm using matplotlib 0.98.3
>
> Thanks
>
> Goyo
>
>
> Sample code -- you need a combination of python shell and matplotlib GUI
> which allows for interactive use in order to get this working as
> expected:
>
> ----------------------------------------
>
> from matplotlib import pyplot
> from matplotlib import dates
> from datetime import datetime, timedelta
> from numpy import random
>
> pyplot.ion()
>
> # create data
> dstart = datetime(2008, 1, 1, 0, 0)
> dend = datetime(2008, 1, 5, 23, 50)
> delta = timedelta(minutes=10)
> x = dates.drange(dstart, dend, delta)
> y = random.random_sample(len(x))
>
> # plot data
> pyplot.plot(x, y)
>
> # format x tick labels
> axis = pyplot.gca()
> fig = pyplot.gcf()
> axis.xaxis.set_major_formatter(dates.DateFormatter('%Y-%b-%d %H:%M'))
> fig.autofmt_xdate()
>
> # draw the figure
> pyplot.draw()
>
> --------------------------------------
>
> Look at the tick labels, they show both date and time even if you zoom
> and pan using the GUI.
>
> Now if I want to look at the second day:
>
> dstart = datetime(2008, 1, 1, 0, 0)
> dend = datetime(2008, 1, 1, 23, 50)
> pyplot.xlim(dstart, dend)
>
> And the format has changed.
I don't see this problem using ipython -pylab with mpl from svn on
linux, gtkagg backend. What version, backend, and platform are you using?
Eric
|
|
From: Goyo <goy...@gm...> - 2008-10-12 23:17:09
|
El lun, 13-10-2008 a las 00:41 +0200, Goyo escribió:
> But I don't know how to set the dpi value this way. I tried to use the
> OO API but no success.
Well yes...
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot
fig = pyplot.figure(dpi=100)
ax = fig.add_subplot('111')
ax.plot([1, 2, 3], [1, 2, 3])
fig.savefig('test.jpg')
But changing the dpi value has no effect so maybe I'm missing something.
Goyo
|
|
From: Eric F. <ef...@ha...> - 2008-10-12 23:16:32
|
Goyo wrote:
> I can't make much sense of this. You don't plot anything and don't use
> canvas.
>
> This code works:
>
> import matplotlib
> matplotlib.use('GTKAgg')
> from matplotlib import pyplot
> pyplot.plot([0, 1, 2, 3], [0, 1, 2, 3])
> fig = pyplot.gcf()
> fig.savefig('test.jpg')
fig.savefig('test.jpg', dpi=150) # or whatever dpi you want
If you are only using savefig, not plotting to the screen, then you
might as well use the agg backend, not the gtkagg.
Eric
>
> But I don't know how to set the dpi value this way. I tried to use the
> OO API but no success.
>
> Goyo
>
> El dom, 12-10-2008 a las 23:45 +0200, Jesper Larsen escribió:
>> Hi matplotlib-users,
>>
>> I decided to try to make some plots that I have previously made in png
>> format using the Agg backend in jpeg format using the GTKAgg backend
>> (which I guess is the one I should use for this). Unfortunately my
>> script exits with an error. I have therefore created a simple test
>> script (test.py) that illustrates the problem (at least on my
>> computer):
>>
>> import matplotlib
>> from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as
>> FigureCanvas
>>
>> fig = matplotlib.figure.Figure(dpi=100)
>> canvas = FigureCanvas(fig)
>> fig.savefig('test.jpg')
>>
>> When I run it I get:
>>
>> $ python test.py
>> /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:357:
>> GtkWarning: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED
>> (widget) || GTK_IS_INVISIBLE (widget)' failed
>> gtk.DrawingArea.realize(self)
>> /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:360:
>> GtkWarning: gdk_pixmap_new: assertion `(drawable != NULL) || (depth !=
>> -1)' failed
>> pixmap = gdk.Pixmap (self.window, width, height)
>> Traceback (most recent call last):
>> File "test.py", line 6, in <module>
>> fig.savefig('test.jpg')
>> File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
>> 964, in savefig
>> self.canvas.print_figure(*args, **kwargs)
>> File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
>> line 1310, in print_figure
>> **kwargs)
>> File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
>> line 347, in print_jpeg
>> return self._print_image(filename, 'jpeg')
>> File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
>> line 360, in _print_image
>> pixmap = gdk.Pixmap (self.window, width, height)
>> RuntimeError: could not create GdkPixmap object
>>
>> I am using matplotlib 0.98.3, pygtk 2.14.0. My system is a Linux Ubuntu:
>>
>> $ uname -a
>> Linux <blanket out> #1 SMP Wed Aug 20 18:39:13 UTC 2008 i686 GNU/Linux
>>
>> Does anyone know what is wrong?
>>
>> Best regards,
>> Jesper
|
|
From: Goyo <goy...@gm...> - 2008-10-12 22:41:41
|
I can't make much sense of this. You don't plot anything and don't use
canvas.
This code works:
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot
pyplot.plot([0, 1, 2, 3], [0, 1, 2, 3])
fig = pyplot.gcf()
fig.savefig('test.jpg')
But I don't know how to set the dpi value this way. I tried to use the
OO API but no success.
Goyo
El dom, 12-10-2008 a las 23:45 +0200, Jesper Larsen escribió:
> Hi matplotlib-users,
>
> I decided to try to make some plots that I have previously made in png
> format using the Agg backend in jpeg format using the GTKAgg backend
> (which I guess is the one I should use for this). Unfortunately my
> script exits with an error. I have therefore created a simple test
> script (test.py) that illustrates the problem (at least on my
> computer):
>
> import matplotlib
> from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as
> FigureCanvas
>
> fig = matplotlib.figure.Figure(dpi=100)
> canvas = FigureCanvas(fig)
> fig.savefig('test.jpg')
>
> When I run it I get:
>
> $ python test.py
> /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:357:
> GtkWarning: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED
> (widget) || GTK_IS_INVISIBLE (widget)' failed
> gtk.DrawingArea.realize(self)
> /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:360:
> GtkWarning: gdk_pixmap_new: assertion `(drawable != NULL) || (depth !=
> -1)' failed
> pixmap = gdk.Pixmap (self.window, width, height)
> Traceback (most recent call last):
> File "test.py", line 6, in <module>
> fig.savefig('test.jpg')
> File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
> 964, in savefig
> self.canvas.print_figure(*args, **kwargs)
> File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
> line 1310, in print_figure
> **kwargs)
> File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
> line 347, in print_jpeg
> return self._print_image(filename, 'jpeg')
> File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
> line 360, in _print_image
> pixmap = gdk.Pixmap (self.window, width, height)
> RuntimeError: could not create GdkPixmap object
>
> I am using matplotlib 0.98.3, pygtk 2.14.0. My system is a Linux Ubuntu:
>
> $ uname -a
> Linux <blanket out> #1 SMP Wed Aug 20 18:39:13 UTC 2008 i686 GNU/Linux
>
> Does anyone know what is wrong?
>
> Best regards,
> Jesper
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Goyo <goy...@gm...> - 2008-10-12 21:57:50
|
Hi all,
I'm plotting time series and using a custom format for x tick labels
because I want to see both date and time. But calling xlim makes the
default format return -- only dates or only times, it depends on the
displayed interval.
I can get my preferred format back by calling set_major_formatter again,
but this is inconvenient for interactive use.
I wonder if there is a better way for changing x limits while keeping
tick labels format unchanged.
I'm using matplotlib 0.98.3
Thanks
Goyo
Sample code -- you need a combination of python shell and matplotlib GUI
which allows for interactive use in order to get this working as
expected:
----------------------------------------
from matplotlib import pyplot
from matplotlib import dates
from datetime import datetime, timedelta
from numpy import random
pyplot.ion()
# create data
dstart = datetime(2008, 1, 1, 0, 0)
dend = datetime(2008, 1, 5, 23, 50)
delta = timedelta(minutes=10)
x = dates.drange(dstart, dend, delta)
y = random.random_sample(len(x))
# plot data
pyplot.plot(x, y)
# format x tick labels
axis = pyplot.gca()
fig = pyplot.gcf()
axis.xaxis.set_major_formatter(dates.DateFormatter('%Y-%b-%d %H:%M'))
fig.autofmt_xdate()
# draw the figure
pyplot.draw()
--------------------------------------
Look at the tick labels, they show both date and time even if you zoom
and pan using the GUI.
Now if I want to look at the second day:
dstart = datetime(2008, 1, 1, 0, 0)
dend = datetime(2008, 1, 1, 23, 50)
pyplot.xlim(dstart, dend)
And the format has changed.
|
|
From: Mathew Y. <my...@jp...> - 2008-10-12 21:57:04
|
never mind. Got it working. One annoying thing, though, when the line reaches the edge of the figure, a line is drawn horizontally to the other side. This doesn't happen when I display all of the points at once. Mathew Mathew Yeates wrote: > something isn't working > In my main routine I have > xpt,ypt= m(lons[0:500],lats[0:500]) > outlines=m.plot(xpt,ypt,'r-') #m is my basemap, outlines is a list of > size 1. Huh? > > then in my update routine I have > counter=0 > def update(): > global counter > xpt,ypt= > m(lons[counter*500:(counter+1)*500],lats[counter*500:(counter+1)*500]) > counter += 1 > outlines[0].set_data(xpt,ypt) > canvas.draw_idle() > return True > > but this produces strange results. After a few iterations the line > disappears completely. Is it wrong to use lists when I get xpt and ypt? > > Mathew > > > > > > Jeff Whitaker wrote: > >> Mathew Yeates wrote: >> >>> Hi >>> >>> I see the example of updating a plot in >>> examples/animation/gtk_timeout.py where the 2 lines >>> ---- >>> line.set_ydata(np.random.rand(10)) >>> fig.canvas.draw_idle() >>> ---- >>> >>> >>> What is the equivalent when I want to update a Basemap with new >>> latitudes and longitudes and I have done >>> m=Basemap(......) >>> m.plot(longitude_list,latitude_list) >>> >>> Thanks >>> Mathew >>> >>> >> Mathew: The Basemap plot method returns a list of matplotlib Line2d >> objects which you can use just as in the example. >> >> -Jeff >> >> > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Jeff W. <js...@fa...> - 2008-10-12 21:56:33
|
Mathew Yeates wrote: > something isn't working > In my main routine I have > xpt,ypt= m(lons[0:500],lats[0:500]) > outlines=m.plot(xpt,ypt,'r-') #m is my basemap, outlines is a list of > size 1. Huh? Mathew: It's one line, so the list has one Line2D object. > > then in my update routine I have > counter=0 > def update(): > global counter > xpt,ypt= > m(lons[counter*500:(counter+1)*500],lats[counter*500:(counter+1)*500]) > counter += 1 > outlines[0].set_data(xpt,ypt) > canvas.draw_idle() > return True > > but this produces strange results. After a few iterations the line > disappears completely. Is it wrong to use lists when I get xpt and ypt? > > Mathew Don't really understand what you're trying to do here, so I can't comment. -Jeff > > > > > > Jeff Whitaker wrote: >> Mathew Yeates wrote: >>> Hi >>> >>> I see the example of updating a plot in >>> examples/animation/gtk_timeout.py where the 2 lines >>> ---- >>> line.set_ydata(np.random.rand(10)) >>> fig.canvas.draw_idle() >>> ---- >>> >>> >>> What is the equivalent when I want to update a Basemap with new >>> latitudes and longitudes and I have done >>> m=Basemap(......) >>> m.plot(longitude_list,latitude_list) >>> >>> Thanks >>> Mathew >>> >> >> Mathew: The Basemap plot method returns a list of matplotlib Line2d >> objects which you can use just as in the example. >> >> -Jeff >> > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Jesper L. <jes...@gm...> - 2008-10-12 21:51:30
|
Hi matplotlib-users,
I decided to try to make some plots that I have previously made in png
format using the Agg backend in jpeg format using the GTKAgg backend
(which I guess is the one I should use for this). Unfortunately my
script exits with an error. I have therefore created a simple test
script (test.py) that illustrates the problem (at least on my
computer):
import matplotlib
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as
FigureCanvas
fig = matplotlib.figure.Figure(dpi=100)
canvas = FigureCanvas(fig)
fig.savefig('test.jpg')
When I run it I get:
$ python test.py
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:357:
GtkWarning: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED
(widget) || GTK_IS_INVISIBLE (widget)' failed
gtk.DrawingArea.realize(self)
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:360:
GtkWarning: gdk_pixmap_new: assertion `(drawable != NULL) || (depth !=
-1)' failed
pixmap = gdk.Pixmap (self.window, width, height)
Traceback (most recent call last):
File "test.py", line 6, in <module>
fig.savefig('test.jpg')
File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
964, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
line 1310, in print_figure
**kwargs)
File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 347, in print_jpeg
return self._print_image(filename, 'jpeg')
File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 360, in _print_image
pixmap = gdk.Pixmap (self.window, width, height)
RuntimeError: could not create GdkPixmap object
I am using matplotlib 0.98.3, pygtk 2.14.0. My system is a Linux Ubuntu:
$ uname -a
Linux <blanket out> #1 SMP Wed Aug 20 18:39:13 UTC 2008 i686 GNU/Linux
Does anyone know what is wrong?
Best regards,
Jesper
|
|
From: Mathew Y. <my...@jp...> - 2008-10-12 21:12:07
|
something isn't working
In my main routine I have
xpt,ypt= m(lons[0:500],lats[0:500])
outlines=m.plot(xpt,ypt,'r-') #m is my basemap, outlines is a list of
size 1. Huh?
then in my update routine I have
counter=0
def update():
global counter
xpt,ypt=
m(lons[counter*500:(counter+1)*500],lats[counter*500:(counter+1)*500])
counter += 1
outlines[0].set_data(xpt,ypt)
canvas.draw_idle()
return True
but this produces strange results. After a few iterations the line
disappears completely. Is it wrong to use lists when I get xpt and ypt?
Mathew
Jeff Whitaker wrote:
> Mathew Yeates wrote:
>> Hi
>>
>> I see the example of updating a plot in
>> examples/animation/gtk_timeout.py where the 2 lines
>> ----
>> line.set_ydata(np.random.rand(10))
>> fig.canvas.draw_idle()
>> ----
>>
>>
>> What is the equivalent when I want to update a Basemap with new
>> latitudes and longitudes and I have done
>> m=Basemap(......)
>> m.plot(longitude_list,latitude_list)
>>
>> Thanks
>> Mathew
>>
>
> Mathew: The Basemap plot method returns a list of matplotlib Line2d
> objects which you can use just as in the example.
>
> -Jeff
>
|
|
From: Jeff W. <js...@fa...> - 2008-10-12 18:37:30
|
Mathew Yeates wrote: > Hi > > I see the example of updating a plot in > examples/animation/gtk_timeout.py where the 2 lines > ---- > line.set_ydata(np.random.rand(10)) > fig.canvas.draw_idle() > ---- > > > What is the equivalent when I want to update a Basemap with new > latitudes and longitudes and I have done > m=Basemap(......) > m.plot(longitude_list,latitude_list) > > Thanks > Mathew > Mathew: The Basemap plot method returns a list of matplotlib Line2d objects which you can use just as in the example. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |