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
(14) |
2
(11) |
|
3
(5) |
4
(17) |
5
(11) |
6
(37) |
7
(35) |
8
(9) |
9
(1) |
|
10
(9) |
11
(7) |
12
(22) |
13
(34) |
14
(24) |
15
(27) |
16
(13) |
|
17
(19) |
18
(43) |
19
(36) |
20
(12) |
21
(9) |
22
(21) |
23
(3) |
|
24
(5) |
25
(30) |
26
(14) |
27
(23) |
28
(19) |
29
(19) |
30
(10) |
|
31
(6) |
|
|
|
|
|
|
|
From: Alan G I. <ala...@gm...> - 2009-05-25 21:46:21
|
> On Mon, May 25, 2009 at 12:35 PM, Alan G Isaac <ala...@gm...> wrote: >> What is the "right" way to produce date-range bars, >> like the recession bars in >> http://research.stlouisfed.org/fred2/series/TB3MS?cid=116 On 5/25/2009 1:45 PM John Hunter apparently wrote: > axvspan. See > > http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.axvspan > http://matplotlib.sourceforge.net/examples/pylab_examples/axhspan_demo.html Great! Thanks, Alan |
|
From: marcusantonius <mar...@st...> - 2009-05-25 21:27:45
|
Thank you very much for your email. Your example >imshow(rand(10,10)*8, vmin=0, vmax=8) >colorbar(ticks=[0,2,4,6,8]) works fine. >Note also that to get the sequence [0,2,4,6,8] you need arange(0,9,2), >not arange(0,8,2). Or you can use linspace(0,8,5) if you prefer. Thank you for making me aware of that (You see that I don't have a lot of experience in python and matplotlib). I now specified the color range via vmin and vmax, and this solved my problem. Thanks for the fast help -- View this message in context: http://www.nabble.com/Colorbar-Ticks-tp23712716p23713404.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2009-05-25 21:09:07
|
marcusantonius wrote: > I should perhaps mention, that if i try > cbar=fig.colorbar(p1,orientation='horizontal',ticks=[0.0,2.0,4.0,6.0,8.0]) The ticks that it uses are taken from the list--they are the ones that are within the range of numbers mapped to colors. The list of ticks does not set that range. > cbar.ax.set_xticklabels(['0', '2', '4','6','8']) Setting ticklabels is dangerous unless you do it based on first getting the actual ticks and using their values, or if you are otherwise sure of their values. But it should be very rare that you have to do this. > the colorbar is drawn correctly, but I get the label 0 at position 2, the > label 2 at position 4 and 4 at pos. 6, the labels at the end are not > drawn... None of the labels correspond to their ticks in this case. Eric |
|
From: Eric F. <ef...@ha...> - 2009-05-25 21:02:35
|
marcusantonius wrote: > Hello, > > I have the problem, that sometimes the first and last ticklabel of a > colorbar is not drawn. E.g. if I create a colorbar through > fig.colorbar(p3,orientation='horizontal',ticks=np.arange(0.0,8,2)) > I only get ticklabels at 2,4,6, but I would like it to have 0,2,4,6,8 and I > don't know how to control this behaviour. If I do > cb=fig.colorbar(p3,orientation='horizontal',ticks=np.arange(0.0,8,2)) > cb.ax.xaxis.set_ticks(np.arange(0,8,2)) > the colorbar vanishes and instead I have 4 ticks with the labels > 0.8,1.6,2.4,3.2 > > Thank you for your help, > Markus > > Markus, The problem here is not the specification of the ticks, it is the actual range of the colorbar, which is taken from the norm object used in the color mapping. Try this (in ipython -pylab): imshow(rand(10,10)*8, vmin=0, vmax=8) colorbar(ticks=[0,2,4,6,8]) Alternatively, you can use the set_clim() method on any Mappable such as an image, or the pyplot clim() function, to set the limits. Note also that to get the sequence [0,2,4,6,8] you need arange(0,9,2), not arange(0,8,2). Or you can use linspace(0,8,5) if you prefer. Eric |
|
From: marcusantonius <mar...@st...> - 2009-05-25 20:59:06
|
I should perhaps mention, that if i try cbar=fig.colorbar(p1,orientation='horizontal',ticks=[0.0,2.0,4.0,6.0,8.0]) cbar.ax.set_xticklabels(['0', '2', '4','6','8']) the colorbar is drawn correctly, but I get the label 0 at position 2, the label 2 at position 4 and 4 at pos. 6, the labels at the end are not drawn... -- View this message in context: http://www.nabble.com/Colorbar-Ticks-tp23712716p23712944.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: marcusantonius <mar...@st...> - 2009-05-25 20:38:48
|
Hello, I have the problem, that sometimes the first and last ticklabel of a colorbar is not drawn. E.g. if I create a colorbar through fig.colorbar(p3,orientation='horizontal',ticks=np.arange(0.0,8,2)) I only get ticklabels at 2,4,6, but I would like it to have 0,2,4,6,8 and I don't know how to control this behaviour. If I do cb=fig.colorbar(p3,orientation='horizontal',ticks=np.arange(0.0,8,2)) cb.ax.xaxis.set_ticks(np.arange(0,8,2)) the colorbar vanishes and instead I have 4 ticks with the labels 0.8,1.6,2.4,3.2 Thank you for your help, Markus -- View this message in context: http://www.nabble.com/Colorbar-Ticks-tp23712716p23712716.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Christoph G. <cg...@uc...> - 2009-05-25 19:52:20
|
Hi, I can confirm the crash of python.exe when saving PNG files using matplotlib 0.98.5.3 under Python 2.5.4 and 2.6.2 (32 bit binaries from python.org) on Windows Vista 64 bit. Saving to a PDF file works. The crash occurs in _png.write_png(). When replacing the file _png.pyd with version 0.98.5.2 saving of PNG files works. There were no changes in the write_png function since 0.98.5.2. import matplotlib matplotlib.use('Agg') from matplotlib import pylab pylab.plot([0], [0]) pylab.savefig("test.png") # crashes here pylab.close() Thanks, Christoph |
|
From: Esmail <eb...@ho...> - 2009-05-25 18:25:20
|
Hi again, John Hunter wrote: > > One thing I just noticed -- you call show before savefig. show is > supposed to be the last line in your script, and should only be called > once. Does moving it to the end help? No, that's just an artifact of my trying a number of things :-) for the pdf file save it makes no difference (but I tried both ways). In the case of the png it always crashes, though it does create a zero-byte file with the correct name. Esmail |
|
From: John H. <jd...@gm...> - 2009-05-25 18:06:57
|
On Mon, May 25, 2009 at 1:01 PM, Esmail <eb...@ho...> wrote: > Hello John, > > \John Hunter wrote: >> On Mon, May 25, 2009 at 12:32 PM, Esmail <eb...@ho...> wrote: >>> Hi all, >>> >>> I'm new to pylab/matplotlib, so perhaps I am making a mistake here, >>> but when I try to save a plot under Windows as a png file, the program >>> crashes (pdf works fine). >>> >> >> I don't have a windows box to test on today (I can try tomorrow from >> work). > > That would be helpful. > >> Most likely, you have a problem of an install over an old >> install. Try installing mpl and numpy cleanly by removing all the >> numpy* and matplotlib* files from your site-packages dir and >> reinstalling. > > I didnt' have either of those packages installed before, so that > should not be a problem, but I will take a look at the links you > sent. > > Thanks .. it'll be interesting to see if the problem can be > reproduced. One thing I just noticed -- you call show before savefig. show is supposed to be the last line in your script, and should only be called once. Does moving it to the end help? JDH |
|
From: Esmail <eb...@ho...> - 2009-05-25 18:01:56
|
Hello John, \John Hunter wrote: > On Mon, May 25, 2009 at 12:32 PM, Esmail <eb...@ho...> wrote: >> Hi all, >> >> I'm new to pylab/matplotlib, so perhaps I am making a mistake here, >> but when I try to save a plot under Windows as a png file, the program >> crashes (pdf works fine). >> > > I don't have a windows box to test on today (I can try tomorrow from > work). That would be helpful. > Most likely, you have a problem of an install over an old > install. Try installing mpl and numpy cleanly by removing all the > numpy* and matplotlib* files from your site-packages dir and > reinstalling. I didnt' have either of those packages installed before, so that should not be a problem, but I will take a look at the links you sent. Thanks .. it'll be interesting to see if the problem can be reproduced. Esmail |
|
From: John H. <jd...@gm...> - 2009-05-25 17:48:58
|
On Mon, May 25, 2009 at 12:32 PM, Esmail <eb...@ho...> wrote: > Hi all, > > I'm new to pylab/matplotlib, so perhaps I am making a mistake here, > but when I try to save a plot under Windows as a png file, the program > crashes (pdf works fine). > I don't have a windows box to test on today (I can try tomorrow from work). Most likely, you have a problem of an install over an old install. Try installing mpl and numpy cleanly by removing all the numpy* and matplotlib* files from your site-packages dir and reinstalling. See also http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#matplotlib-install-location http://matplotlib.sourceforge.net/faq/installing_faq.html#cleanly-rebuild-and-reinstall-everything JDH |
|
From: John H. <jd...@gm...> - 2009-05-25 17:45:39
|
On Mon, May 25, 2009 at 12:35 PM, Alan G Isaac <ala...@gm...> wrote: > What is the "right" way to produce date-range bars, > like the recession bars in > http://research.stlouisfed.org/fred2/series/TB3MS?cid=116 axvspan. See http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.axvspan http://matplotlib.sourceforge.net/examples/pylab_examples/axhspan_demo.html JDH |
|
From: John H. <jd...@gm...> - 2009-05-25 17:43:21
|
On Mon, May 25, 2009 at 7:16 AM, <jor...@ya...> wrote:
>
>
> Hi,
> I am trying to use matplotlib to visually explore some data. I started
> from the "event_handling example code: data_browser.py" example, but
> wanted to go a bit further. The idea is to have two plots and an image
> linked together. The first plot represents a measure calculated from
> an image region at different times of the day. Selecting one of this
> measures shows the corresponding image, and some other measure calculated
> from the individual pixels. Further on, selecting in the image or the
> second plot should highlight the corresponding point in the plot or pixel
> on the image, respectively (That is, the first plot is linked to the image,
> and the image and the second plot are linked together).
> My problem is that on the function being called upon and event, I always
> get events generated by the image, even when the moused was clicked on one of
> the other plots. The plots behave ok.
> The coded below is a simplified functional version (the measures here are
> trivial, and I haven't included the actions when the user selects the image or
> the second plot), which exhibits this behavior. What I see when executing this
> code is for example:
>
It looks like you found a pretty significant bug -- the Artist.pick
method forwards the event to all of it's children, whether or not the
pick event happened in the same Axes as the event being queried. Not
only is this inefficient, it can create false positives when the two
axes share a similar coord system. I just committed a fix to svn, to
make sure the artist axes instance is the same as the pick event
inaxes attribute before forwarding on the call. artist.Artist.pick
now reads:
# Pick children
for a in self.get_children():
# make sure the event happened in the same axes
ax = getattr(a, 'axes', None)
if mouseevent.inaxes==ax:
a.pick(mouseevent)
This seems to fix the problem you identified -- give svn r7141 or
later a test drive if you have access
http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
JDH
|
|
From: Alan G I. <ala...@gm...> - 2009-05-25 17:35:07
|
What is the "right" way to produce date-range bars, like the recession bars in http://research.stlouisfed.org/fred2/series/TB3MS?cid=116 Thanks, Alan Isaac |
|
From: Esmail <eb...@ho...> - 2009-05-25 17:32:32
|
Hi all,
I'm new to pylab/matplotlib, so perhaps I am making a mistake here,
but when I try to save a plot under Windows as a png file, the program
crashes (pdf works fine).
This is the short script I am running:
-------------
import pylab as plt
plt.grid(True)
# plot a point
x = 1.5
y = 0.7
plt.plot([x], [y], 'ro')
plt.show()
#plt.savefig('plot_point2.pdf')
plt.savefig('plot_point2.png')
--------------
Win XP Prof, SP 2. Downloaded maptplotlib 0.98.5.3 today along with
numpy 1.3.0 (running Python 2.6.1).
Can someone else reproduce this problem? Is this a known problem?
Thanks,
Esmail
|
|
From: Eric F. <ef...@ha...> - 2009-05-25 17:27:05
|
Jean-Christophe Penalva wrote: > Hello, > > i draw some rectangle (with PolyCollection) on one figure. I'd like to put > around (on the right vertical, or at the bottom horizontal) a colormap > with the > min and max values (as in > http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html) > > > Here is a part of my code > > ... > c = collections.PolyCollection(list_rect) > c.set_array(liste_colormap) > c.set_cmap(cm.hot) c is a PolyCollection instance > fig = plt.figure(figsize=(16, 12)) > ax = fig.add_subplot(111) > ax.add_collection(c) > ax.set_xlim(xorig, xmax) > ax.set_ylim(yorig, ymax) > ax.set_yticks((ymax/6, (ymax/6)*3, (ymax/6)*5)) > ax.set_yticklabels(('Rangee 1', 'Rangee 2','Rangee 3')) > plt.title(str(num_semaine)+"-"+str(annee)) > cmap=cmap,norm=norm,orientation='horizontal') > plt.colorbar(cax=c, ax=ax) but cax is looking for an axes instance in which to draw the colorbar. Try omitting that kwarg. The colorbar axes will be made automatically. Eric > plt.plot() > plt.savefig("s"+str(num_semaine)+"-"+str(annee)+".png") > > At the end, there's a message : > Traceback (most recent call last): > File "/.../graph4.1.2.py", line 260, in <module> > plt.colorbar(cax=c, ax=ax) > File "/usr/lib/python2.6/dist-packages/matplotlib/pyplot.py", line > 1326, in > colorbar > ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) > File "/usr/lib/python2.6/dist-packages/matplotlib/figure.py", line > 1002, in > colorbar > cax.hold(True) > AttributeError: 'PolyCollection' object has no attribute 'hold' > > Any idea ?? > > Thank you. > > ###################################################################### > Jean-Christophe Penalva > Centre Informatique National de l'Enseignement Superieur (CINES) > Montpellier, FRANCE > Tel : 33 4 67 141 414 Fax : 33 4 67 523 763 > http://www.cines.fr/ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://www.creativitycat.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: John H. <jd...@gm...> - 2009-05-25 17:11:44
|
On Mon, May 25, 2009 at 9:02 AM, collern2 <noe...@gm...> wrote: > > I'm trying to have the points start from the x-axis (similar to a histogram) > and draw lines upwards. I've attached an image of the program output, as you > can see - there are no red lines from 0-200 on the y-axis. Any ideas how to > start them from zero? > > http://www.nabble.com/file/p23707480/image.png > > Sample value from list entry for time[] > 693596.000003 > Sample value from list entry for latency[] > 1043 > > ######### > Sample Code > ######### > > > def plot_graph(): > > # Plotting the graph > plt.plot(time[5300:],latency[5300:], 'r-', linewidth=0.15) It sounds like you want vlines http://matplotlib.sourceforge.net/search.html?q=codex+vlines http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.vlines Eg, plt.vlines(time[5300:], 0, latenc[5300:], color='red', lw=0.15) JDH |
|
From: Jean-Christophe P. <jea...@ci...> - 2009-05-25 14:14:04
|
<HTML> <HEAD> <META content="text/html; charset=iso-8859-9" http-equiv=Content-Type> <META content="OPENWEBMAIL" name=GENERATOR> </HEAD> <BODY bgColor=#ffffff> <font size="2"> Hello, <br /> <br /> i draw some rectangle (with PolyCollection) on one figure. I'd like to put <br /> around (on the right vertical, or at the bottom horizontal) a colormap with the <br /> min and max values (as in <br /> <a target="_blank" href="http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html">http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html</a>) <br /> <br /> Here is a part of my code <br /> <br /> <span style="font-family: courier new,courier,monospace;">... </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> c = collections.PolyCollection(list_rect) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> c.set_array(liste_colormap) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> c.set_cmap(cm.hot) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> fig = plt.figure(figsize=(16, 12)) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax = fig.add_subplot(111) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.add_collection(c) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.set_xlim(xorig, xmax) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.set_ylim(yorig, ymax) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.set_yticks((ymax/6, (ymax/6)*3, (ymax/6)*5)) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.set_yticklabels(('Rangee 1', 'Rangee 2','Rangee 3')) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.title(str(num_semaine)+"-"+str(annee)) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> cmap=cmap,norm=norm,orientation='horizontal') </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.colorbar(cax=c, ax=ax) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.plot() </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.savefig("s"+str(num_semaine)+"-"+str(annee)+".png") </span> <br /> <br /> At the end, there's a message : <br /> <span style="font-family: courier new,courier,monospace;">Traceback (most recent call last): </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> File "/.../graph4.1.2.py", line 260, in <module> </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.colorbar(cax=c, ax=ax) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> File "/usr/lib/python2.6/dist-packages/matplotlib/pyplot.py", line 1326, in </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> colorbar </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> File "/usr/lib/python2.6/dist-packages/matplotlib/figure.py", line 1002, in </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> colorbar </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> cax.hold(True) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> AttributeError: 'PolyCollection' object has no attribute 'hold' </span> <br /> <br /> Any idea ?? <br /> <br /> Thank you. <br /> <br /> ###################################################################### <br /> Jean-Christophe Penalva <br /> Centre Informatique National de l'Enseignement Superieur (CINES) <br /> Montpellier, FRANCE <br /> Tel : 33 4 67 141 414 Fax : 33 4 67 523 763 <br /> <a target="_blank" href="http://www.cines.fr/">http://www.cines.fr/</a> <br /> </font> </BODY> </HTML> |
|
From: collern2 <noe...@gm...> - 2009-05-25 14:11:56
|
I'm trying to have the points start from the x-axis (similar to a histogram) and draw lines upwards. I've attached an image of the program output, as you can see - there are no red lines from 0-200 on the y-axis. Any ideas how to start them from zero? http://www.nabble.com/file/p23707480/image.png Sample value from list entry for time[] 693596.000003 Sample value from list entry for latency[] 1043 ######### Sample Code ######### def plot_graph(): # Plotting the graph plt.plot(time[5300:],latency[5300:], 'r-', linewidth=0.15) # Define the axes y_label = [0, 200, 400, 600, 800, 1000, 1200] plt.axes().set_xlim(xmin=datetime.datetime(1900,1,1,0,0,0,0), xmax=time[-1]) plt.axes().set_ylim(ymin=0, ymax=1400) plt.axes().set_xticklabels(time, fontdict=None, minor=False, size=10) plt.axes().set_yticklabels(y_label, fontdict=None, minor=False, size=10) # Labeling the graph ax = p.subplot(111) ax.xaxis.set_major_locator(MaxNLocator(7)) plt.gca().xaxis.set_major_formatter(DateFormatter('%M:%S')) plt.xlabel(x_axis) plt.ylabel(y_axis) plt.title(title) # Grid plt.grid(True) plt.grid(alpha=0.1, color='black', linestyle='-', linewidth=0.1) plt.savefig(figure) # plot the graph plot_graph() -- View this message in context: http://www.nabble.com/Ensure-vertical-lines-start-from-x-axis-tp23707480p23707480.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: <jor...@ya...> - 2009-05-25 13:16:53
|
Hi,
I am trying to use matplotlib to visually explore some data. I started
from the "event_handling example code: data_browser.py" example, but
wanted to go a bit further. The idea is to have two plots and an image
linked together. The first plot represents a measure calculated from
an image region at different times of the day. Selecting one of this
measures shows the corresponding image, and some other measure calculated
from the individual pixels. Further on, selecting in the image or the
second plot should highlight the corresponding point in the plot or pixel
on the image, respectively (That is, the first plot is linked to the image,
and the image and the second plot are linked together).
My problem is that on the function being called upon and event, I always
get events generated by the image, even when the moused was clicked on one of
the other plots. The plots behave ok.
The coded below is a simplified functional version (the measures here are
trivial, and I haven't included the actions when the user selects the image or
the second plot), which exhibits this behavior. What I see when executing this
code is for example:
Actions (click on) Results (from the print statement on the
onpick() function)
plot1 plot1
image2
image2 image2
plot3 plot3
image2
Am I doing something wrong? I am new to both python and matplotlib, so if you
see something that could be done in a better way, please tell me.
Jorges
----- Test code -----
import os
import sys
import glob
import re
import fnmatch
import Image as im
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import scipy.stats
class LCRBrowser():
"""
Permits to visualize log chromaticity ratios and related things for
analysing static images taken at throughout a period of time
"""
def __init__(self, data):
# Initialize instance attributes
self.lcr = np.asarray(map((lambda x: x['lcr']), data))
self.lcr_ind = np.asarray(map((lambda x: x['lcr_ind']), data))
self.img = np.asarray(map((lambda x: x['img']), data))
self.lastind = 0
# Initial drawing and picking init
self.fig = plt.figure()
self.ax1 = self.fig.add_subplot(311)
self.ax2 = self.fig.add_subplot(312)
self.ax3 = self.fig.add_subplot(313)
self.plot1, = self.ax1.plot(self.lcr, 'o', picker=5)
self.selected, = self.ax1.plot([self.lcr[0]], 'o', ms=12, alpha=0.4,
color='yellow', visible=False)
self.img2 = self.ax2.imshow(self.img[0], visible=True, picker=2,\
interpolation='nearest')
self.plot3, = self.ax3.plot(self.lcr_ind[0][:], 'o', visible=True, picker=5)
print type(self.plot3)
self.fig.canvas.mpl_connect('pick_event', self.onpick)
self.fig.canvas.draw()
def onpick(self, event):
x2 = event.mouseevent.ydata
if event.artist == self.plot1:
print 'plot1\n'
N = len(event.ind)
if not N: return True
distances = x2-self.lcr[event.ind]
indmin = distances.argmin()
dataind = event.ind[indmin]
self.lastind = dataind
elif event.artist == self.img2:
print 'img2\n'
elif event.artist == self.plot3:
print 'plot3\n'
else:
print 'didn\'t detect artist'
print str(event.artist)
return True
self.update()
def update(self):
if self.lastind is None: return
ind = self.lastind
self.img2.set_data(self.img[ind])
a = self.lcr_ind[ind][:]
self.plot3.set_data((range(len(a)), a))
self.fig.canvas.draw()
def main():
results = []
for name in range(5):
img = np.random.rand(5,4,3)
lcr = sp.stats.gmean(np.mean(np.mean(img, 0), 0))
lcr_ind = sp.stats.gmean(img, 2).reshape(-1,1)
result = {'lcr': lcr, 'lcr_ind':lcr_ind, 'img':img}
results.append(result)
LCRBrowser(results)
if __name__ == '__main__':
main()
----- code end -----
|
|
From: John R. C. <ca...@tx...> - 2009-05-25 12:51:11
|
Forgot to cc the list.....JRC John R. Cary wrote: > John Hunter wrote: >> On Sun, May 24, 2009 at 11:18 AM, John R. Cary <ca...@tx...> wrote: >> >>> $ python setup.py install --prefix=/d/facets/contrib >>> ============================================================================ >>> >>> BUILDING MATPLOTLIB >>> matplotlib: 0.98.5 >>> python: 2.5.2 (r252:60911, Dec 15 2008, 17:11:36) [GCC >>> 3.4.6 20060404 (Red Hat 3.4.6-10)] >>> platform: linux2 >>> >>> REQUIRED DEPENDENCIES >>> numpy: 1.2.1.1 >>> freetype2: 9.7.3 >>> >>> OPTIONAL BACKEND DEPENDENCIES >>> libpng: 1.2.7 >>> connect 173.8.244.121 port 6000: Connection timed out >>> X connection to foo.bar.com:12.0 broken (explicit kill or server >>> shutdown). >>> >>> Is this expected? Any way around? >>> >>> Thanks......John Cary >>> >> >> It is not expected in that I do not know why the connection was broken >> (did it once exits, do you expect X connectivity in your build >> environment?). I am not sure why the X connection was broken, whether >> you wanted it, or whether you wanted it to persist. mpl can be built >> w/o an X connection, but not all of the mpl backends can. Details on >> all of the mpl backends can be found here: >> >> http://matplotlib.sourceforge.net/faq/installing_faq.html#backends >> >> A plain vanilla mpl install which can generate PS, PDF, SVG and PNG >> should be buildable w/o an X connection. You can copy the >> setup.cfg.template file which lives alongside setup.py to setup.cfg >> and edit it to turn off optional GUI backend building. >> >> But if you want an mpl install that works with one or more GUIs, you >> may need an X connnection. That is because mpl tries to import one or >> more GUI toolkits at build time to see if they are present as part of >> an auto-configure routine. If they are present, we try and build our >> extensions for them. So, for example, when we try and import pygtk to >> see if we should build our gtk extensions, an X connection is made. >> You might be able to work around this by explicitly stating in >> setup.cfg which backends you want to build, turning off all >> non-essential ones. >> >> > Thanks for your help. Uncommenting the GUI front end lines, > > #gtk = False > #gtkagg = False > #tkagg = False > #wxagg = False > #macosx = False > > allowed this to build. > > Then going back and ssh'ing to the machine with X-forwarding (-Y) worked > as well. I don't understand enough to know why the second worked, but > it did. > > Best regards....John Cary > > > > |
|
From: Ondrej C. <on...@ce...> - 2009-05-25 08:41:13
|
On Mon, May 25, 2009 at 1:03 AM, Robert Cimrman <cim...@nt...> wrote: > Ondrej Certik wrote: >> >> On Fri, May 22, 2009 at 3:37 PM, Ondrej Certik <on...@ce...> wrote: >>> >>> Thanks a lot John. I tried that and it does what I want. I just need >>> to convert and probably average my 3 different values at the 3 >>> vertices of the triangle and color the triangle with that color. When >>> I get it working, I'll send you a picture. :) >> >> Ok, I made a progress, it seems it's working. Script and picture >> attached. You can compare to the mayavi plot above, it's almost >> identical now. It took my some time playing with different parameters >> of mpl to get here and I think it looks quite good. Still one can see >> the artefacts though as John predicted, due to mpl not interpolating >> the triangles. > > Nice! > > Just to prod you a bit: If you want to get rid of the hard mayavi dependence > of femhub for 3D plots too, you could hack a (perspective/whatever) > projection of 3D surface to 2D, remove invisible faces (normal points > backwards) and plot the rest by the painter's algorithm (far faces first). Well, I spent one afternoon playing with cairo, trying to implement the triangle interpolation and the result was slower than matplotlib. So gave up and I'll just use what can be done with mpl currently. As to mayavi, I'd rather make it easier to install. The only tough dependency is VTK, that takes lots of time to build, we already got rid of all the others, so that's good. Ondrej |
|
From: Robert C. <cim...@nt...> - 2009-05-25 08:04:58
|
Ondrej Certik wrote: > On Fri, May 22, 2009 at 3:37 PM, Ondrej Certik <on...@ce...> wrote: >> Thanks a lot John. I tried that and it does what I want. I just need >> to convert and probably average my 3 different values at the 3 >> vertices of the triangle and color the triangle with that color. When >> I get it working, I'll send you a picture. :) > > Ok, I made a progress, it seems it's working. Script and picture > attached. You can compare to the mayavi plot above, it's almost > identical now. It took my some time playing with different parameters > of mpl to get here and I think it looks quite good. Still one can see > the artefacts though as John predicted, due to mpl not interpolating > the triangles. Nice! Just to prod you a bit: If you want to get rid of the hard mayavi dependence of femhub for 3D plots too, you could hack a (perspective/whatever) projection of 3D surface to 2D, remove invisible faces (normal points backwards) and plot the rest by the painter's algorithm (far faces first). r. |
|
From: Bryan C. <br...@co...> - 2009-05-25 07:04:47
|
On Tue, 2009-05-19 at 10:50 +0200, Thomas Pfaff wrote: > Hello there, > > when I started with matplotlib I was really enthusiastic that I can throw > all those Excel, IDL, Matlab and whatever else I used until now overboard > and do everything from data processing to visualization in beloved Python. > > Now, here at work I have to use a Windows PC and PowerPoint and graphics > just look best in PowerPoint if they are in EMF format. > Funny enough there seems to be no converter on the market to properly > convert any other vector format matplotlib can produce to EMF. Even the way > via Inkscape fails even with simple plots. > > If I'm wrong about the converter, please tell me and bury EMF-support. > If not, what would you think would be the effort and the time needed to port > the emf-backend to the latest version of matplotlib? I might at least give > it a try. EMF support in OpenOffice is quite good (OOo uses emf internally, I believe). You can import either SVG or PDF into OOo-Draw using the respective OOo-extension and export as emf from there. bc |
|
From: Eric F. <ef...@ha...> - 2009-05-25 06:14:09
|
per freem wrote:
> hi eric,
>
> i tried your suggestion but it still did not work. here's a code
> snippet that demonstrates what i am trying to do:
No, I'm still baffled. If you stack 3 subplots vertically in a figure 6
inches high, they are going to be small. You can fiddle with their
sizes a bit by using subplots_adjust, but they are still going to be
small--less than 2 inches high. What physical dimensions do you want,
when you say you want the plot to be "scaled bigger"?
Eric
>
> import matplotlib.pyplot as
> plt
> from scipy import
> *
>
>
> my_fig = plt.figure(figsize=(7,6),
> dpi=100)
> plot_ax1 =
> plt.subplot(3,1,1)
> a =
> rand(100)
>
> b = rand(100) +
> rand()
> plt.scatter(a,
> b)
> plot_ax1.set(xticklabels=[])
>
> plot_ax1.set_aspect('equal',
> adjustable='box')
> plt.savefig('myplot.pdf')
>
>
>
> when i run this, i get a small square scatter plot in the middle of the
> page. i want this plot to be scaled to be bigger. if i remove the
> set_aspect() call, the plot becomes bigger in the horizontal direction,
> and is rectangular.
>
> any ideas how to fix this? thanks again.
>
> On Sun, May 24, 2009 at 9:24 PM, Eric Firing <ef...@ha...
> <mailto:ef...@ha...>> wrote:
>
> per freem wrote:
>
> hi all,
>
> i have a series of subplots organized in a column (3x1). i
> noticed that if i plot them then matplotlib tends to make the
> x-axis long and the y-axis short, so the plot is really
> rectangular. how can i make it more square? if i do:
>
> f = figure(figsize=(7,6), dpi=100)
> p1 = subplot(3,1,1)
> plot(....)
> # make axes square
> p1.set_aspect('equal')
>
> p2 = subplot(3,1,2)
> plot(....)
> p2.set_aspect('equal')
>
> # etc for third subplot...
>
> then the subplots i get are square, but very small and squished
> compared to the space they have in the figure (ie what i set in
> figsize.) how can i fix this? i just want to have square axes,
> but have each subplot take up as much space as it would if i
> didnt set square axes... it works fine for the rectangular axes
> case.
>
>
> Maybe what you are looking for is
> p1.set_aspect('equal', adjustable='datalim')
>
> It is not clear from your message, but try the modification above
> and see if it does what you want.
>
> Eric
>
>
|