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
(7) |
2
(12) |
3
(7) |
4
(23) |
5
(5) |
6
(7) |
7
(4) |
8
(7) |
9
(25) |
10
(17) |
11
(25) |
12
(11) |
13
(8) |
14
(6) |
15
(1) |
16
(22) |
17
(11) |
18
(12) |
19
(22) |
20
(32) |
21
(9) |
22
(4) |
23
(16) |
24
(5) |
25
(9) |
26
(26) |
27
(21) |
28
(14) |
29
(6) |
30
(8) |
31
(4) |
|
|
|
|
From: Benjamin R. <ben...@ou...> - 2010-08-27 13:35:42
|
On Fri, Aug 27, 2010 at 7:21 AM, Stan Schymanski <ss...@bg...>wrote: > Dear all, > > I don't know which update it was that broke it, but this used to work: > > import numpy > import pylab > pylab.clf() > fig = pylab.figure(1,figsize=(8,5)) > ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1,5), > ylim=(-4,3)) > > t = numpy.arange(0.0, 5.0, 0.01) > s = numpy.cos(2*numpy.pi*t) > line, = ax.plot(t, s, lw=3, color='purple') > pylab.text(-0.5,3.2,'no data',ha='center') > > pylab.annotate('',(-1,3.1),(0,3.1),va='center',ha='center',arrowprops=dict(arrowstyle='<->')) > pylab.savefig('blah.png') > > This used to plot an arrow under the text 'no data' but above the main > plot. Now this arrow does not appear unless at least part of it is within > the plotting area. Change one of the '3.1' in the code above to, say, 3.0 > and the whole arrow is displayed. Is this a bug or is there a new way of > achieving what I want? > > Thanks for your help already! > > Cheers > Stan > > I wonder if it was one of the fixes to the clipping code. If I plot this to the screen and then move the plot so that the "no data" text is in the plot area, the arrow shows up. So, the question is... was plotting arrows outside the plot area a bug or a feature? And, if it was a bug, what about being able to annotate outside the plot area? Lastly, whatever the outcome, this example should probably become a test because it would be a great way to test for obscure broken behavior. Ben Root P.S. - cc'ing the devel mailing list here... |
From: Stan S. <ss...@bg...> - 2010-08-27 12:22:02
|
Dear all, I don't know which update it was that broke it, but this used to work: import numpy import pylab pylab.clf() fig = pylab.figure(1,figsize=(8,5)) ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1,5), ylim=(-4,3)) t = numpy.arange(0.0, 5.0, 0.01) s = numpy.cos(2*numpy.pi*t) line, = ax.plot(t, s, lw=3, color='purple') pylab.text(-0.5,3.2,'no data',ha='center') pylab.annotate('',(-1,3.1),(0,3.1),va='center',ha='center',arrowprops=dict(arrowstyle='<->')) pylab.savefig('blah.png') This used to plot an arrow under the text 'no data' but above the main plot. Now this arrow does not appear unless at least part of it is within the plotting area. Change one of the '3.1' in the code above to, say, 3.0 and the whole arrow is displayed. Is this a bug or is there a new way of achieving what I want? Thanks for your help already! Cheers Stan |
From: Michele De S. <mic...@gm...> - 2010-08-27 07:30:52
|
Thanks a lot to all of you. First of all, I have to say that I agree with Benjamin Root. I'll try the tools some of you suggested (no problem in installing and trying, as soon as I can ... but it's good to know that there is a way to generate CMYK images using Python ... as I told it will be useful to have these suggestions recorded on the Matplotlib web site). If amongst the readers of this mailing list there are also some Matplotlib developers, I'd like to say them that to have the CMYK option incorporated into Matplotlib (for example like it is incorporated into the MATLAB print command) will be a great improvement. I started using Python only because I wanted to stop using MATLAB. I've found Python a lot more powerful than MATLAB on nearly all aspects. When someone like me has to make some publications and does not have a lot of time to try tools, he will be discouraged in using Matplotlib (and Python) and he will return to MATLAB again (and this is what happened to me until now). So, developers, please seriously consider adding this option to Matplotlib. The first sentence of the web site is "matplotlib is a python 2D plotting library which produces publication quality figures". This is true (I think they're better than Matlab figures) ... I only hope it will be more easy in the future also to actually use those figures in publications. Thanks to all of you. Kind regards, Michele 2010/8/26 Jae-Joon Lee <lee...@gm...>: > While not a full solution, I have been playing with a ps backend that > saves images (and only images) in CMYK color. > lcms is required for color transform. > > http://github.com/leejjoon/mpl_ps_cmyk > > For example, > > import mpl_toolkits.ps_cmyk > plt.savefig("test_cmyk.eps", format="eps_cmyk") > > Regards, > > -JJ > > > > On Fri, Aug 27, 2010 at 6:12 AM, Robert Kern <rob...@gm...> wrote: >> On 8/26/10 3:26 PM, Fernando Perez wrote: >>> On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing<ef...@ha...> wrote: >>>> It's not trivial. This might help: >>>> >>>> http://www.littlecms.com/ >>>> >>>> See the tutorial for some nice background info. >>> >>> And this could be a good start for a python-based workflow: >>> >>> http://www.cazabon.com/pyCMS/ >>> >>> *if* it works (it looks old, so it may have bit-rotted in the meantime). >>> >>> Another option would be to ctypes-wrap the calls of littleCMS one >>> needs just for this and be done with it. Not very elegant, but it >>> might get the OP out of a bind with minimal work, and he'd have a >>> little eps2cmyk.py script he could run on his MPL-generated EPS files >>> for colorspace conversion. Just an afternoon hack. :) >> >> You can also use my numpy-aware wrappers: >> >> http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/lcms/ >> >> -- >> Robert Kern >> >> "I have come to believe that the whole world is an enigma, a harmless enigma >> that is made terrible by our own mad attempt to interpret it as though it had >> an underlying truth." >> -- Umberto Eco >> >> >> ------------------------------------------------------------------------------ >> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program >> Be part of this innovative community and reach millions of netbook users >> worldwide. Take advantage of special opportunities to increase revenue and >> speed time-to-market. Join now, and jumpstart your future. >> http://p.sf.net/sfu/intel-atom-d2d >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michele De Stefano http://www.linkedin.com/in/micdestefano http://code.google.com/p/mds-utils http://micheledestefano.xoom.it |
From: Jae-Joon L. <lee...@gm...> - 2010-08-26 21:39:13
|
While not a full solution, I have been playing with a ps backend that saves images (and only images) in CMYK color. lcms is required for color transform. http://github.com/leejjoon/mpl_ps_cmyk For example, import mpl_toolkits.ps_cmyk plt.savefig("test_cmyk.eps", format="eps_cmyk") Regards, -JJ On Fri, Aug 27, 2010 at 6:12 AM, Robert Kern <rob...@gm...> wrote: > On 8/26/10 3:26 PM, Fernando Perez wrote: >> On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing<ef...@ha...> wrote: >>> It's not trivial. This might help: >>> >>> http://www.littlecms.com/ >>> >>> See the tutorial for some nice background info. >> >> And this could be a good start for a python-based workflow: >> >> http://www.cazabon.com/pyCMS/ >> >> *if* it works (it looks old, so it may have bit-rotted in the meantime). >> >> Another option would be to ctypes-wrap the calls of littleCMS one >> needs just for this and be done with it. Not very elegant, but it >> might get the OP out of a bind with minimal work, and he'd have a >> little eps2cmyk.py script he could run on his MPL-generated EPS files >> for colorspace conversion. Just an afternoon hack. :) > > You can also use my numpy-aware wrappers: > > http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/lcms/ > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco > > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Robert K. <rob...@gm...> - 2010-08-26 21:15:18
|
On 8/26/10 3:26 PM, Fernando Perez wrote: > On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing<ef...@ha...> wrote: >> It's not trivial. This might help: >> >> http://www.littlecms.com/ >> >> See the tutorial for some nice background info. > > And this could be a good start for a python-based workflow: > > http://www.cazabon.com/pyCMS/ > > *if* it works (it looks old, so it may have bit-rotted in the meantime). > > Another option would be to ctypes-wrap the calls of littleCMS one > needs just for this and be done with it. Not very elegant, but it > might get the OP out of a bind with minimal work, and he'd have a > little eps2cmyk.py script he could run on his MPL-generated EPS files > for colorspace conversion. Just an afternoon hack. :) You can also use my numpy-aware wrappers: http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/lcms/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |
From: Christopher B. <Chr...@no...> - 2010-08-26 20:59:58
|
Fernando Perez wrote: >> http://www.littlecms.com/ PIL optionally uses littlecms -- so it may have what you need built in. -Chris NOTE: I haven't read the rest of this thread, to sorry if this is redundant information. -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Fernando P. <fpe...@gm...> - 2010-08-26 20:26:57
|
On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing <ef...@ha...> wrote: > It's not trivial. This might help: > > http://www.littlecms.com/ > > See the tutorial for some nice background info. And this could be a good start for a python-based workflow: http://www.cazabon.com/pyCMS/ *if* it works (it looks old, so it may have bit-rotted in the meantime). Another option would be to ctypes-wrap the calls of littleCMS one needs just for this and be done with it. Not very elegant, but it might get the OP out of a bind with minimal work, and he'd have a little eps2cmyk.py script he could run on his MPL-generated EPS files for colorspace conversion. Just an afternoon hack. :) Regards, f |
From: Ben E. <bed...@cs...> - 2010-08-26 19:42:25
|
Hello, I've used matplotlib for a while but never had cause to ask a question until now. I am trying to add a patch to an axis, but would like the patch to remain the same size when, interactively, I resize the resulting figure. I am using TkAgg, and trying the following: >>> import matplotlib.pyplot as plt >>> import matplotlib.patches as patches >>> ax = plt.gca() >>> cp = patches.Circle((.5,.5),.025) >>> ax.add_patch(cp) >>> ax.set_aspect('equal') >>> plt.draw() >>> plt.show() This gives me a nice blue circle in the middle of the plot, and using ax.set_aspect('equal') I know that it will not be distorted into an ellipse. But is there a way to ensure that when I make the Tk window bigger, that the circle appears to be the same size as it was previously? I assume this would entail some sort of transform, but I don't quite understand how they work... Ben |
From: Eric F. <ef...@ha...> - 2010-08-26 18:39:20
|
On 08/26/2010 05:49 AM, Benjamin Root wrote: > On Thu, Aug 26, 2010 at 9:39 AM, Daπid <dav...@gm... > <mailto:dav...@gm...>> wrote: > > Image Magick and Inkscape seem to work for this. Probably the first > one is easier to automatize in batch processing. > > > Quick warning about ImageMagick and EPS files (and any other > vector-based graphics format)... > > ImageMagick is a raster-based system. When it loads a vector-based > graphic, it implicitly rasterizes it, performs the requested operations, > and then outputs the file format. So, even if you output the result as > a EPS file, you would have lost all vector-based info (like text and > lines). The result looks horrible. > > I have been contemplating adding some sort of functionality like this > for the various formats. I recently ran into issues like this for an > IEEE publication and had to resort to obtaining a copy of Adobe Acrobat > Pro to fix up my images. It would be nice if I could pass an option to > .savefig() like 'use_cmyk=True' or something and be done with it. It's not trivial. This might help: http://www.littlecms.com/ See the tutorial for some nice background info. Eric > > Ben Root > > > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Benjamin R. <ben...@ou...> - 2010-08-26 17:29:49
|
On Thu, Aug 26, 2010 at 11:27 AM, Jonathan Slavin <js...@cf...>wrote: > This is starting to get off topic from matplotlib, but it is relevant to > creating good EPS figures... > > When using ImageMagick to transform from to an EPS, your results will be > much improved by using the parameter "-density 288". This increases the > resolution (and thus results in a much bigger file). I find this is > adequate for producing publication quality plots. > This is getting off-topic, but this is also something that I feel quite strongly about. There is no point in submitting an EPS file that comes from ImageMagick for publication. Because of the rasterization, you might as well send them a PNG file. There are a few reasons why publishers request vector-based graphics formats. First, they can change the font properties and the text of the figure as needed. If the image has been rasterized, they then have to edit out the rasterized text and put in their own text. Second, there are various anti-aliasing techniques that can be utilized for text and lines as one scales the image for different publishing mediums. If you take your high resolution rasterized eps file and try viewing the text when the figure is scaled to a small size, and then try the same for an unrasterized eps file, so long as your viewer is decent, the unrasterized image will remain readable at smaller sizes than the high-resolution rasterized version. Don't rasterize your vector images... your publications will thank you for that! /rant On a related note, you *should* rasterize your pcolor() and imshow() using "rasterize=True" in those function calls. This will allow the image to be rasterized to its native resolution, while still letting everything else in the figure remain vector-based. This results in beautiful plots with sane file sizes. Ben Root |
From: Jonathan S. <js...@cf...> - 2010-08-26 16:27:40
|
This is starting to get off topic from matplotlib, but it is relevant to creating good EPS figures... When using ImageMagick to transform from to an EPS, your results will be much improved by using the parameter "-density 288". This increases the resolution (and thus results in a much bigger file). I find this is adequate for producing publication quality plots. > > Quick warning about ImageMagick and EPS files (and any other > > vector-based graphics format)... > > > > ImageMagick is a raster-based system. When it loads a vector-based > > graphic, it implicitly rasterizes it, performs the requested > > operations, and then outputs the file format. So, even if you > > output the result as a EPS file, you would have lost all > > vector-based info (like text and lines). The result looks horrible. |
From: Carlos G. <car...@gm...> - 2010-08-26 16:06:44
|
Many thanks Tinne. That did it. On Thu, Aug 26, 2010 at 03:55, Tinne De Laet <tin...@me...> wrote: > Hi Carlos, > > On Thu, Aug 26, 2010 at 04:49, Carlos Grohmann > <car...@gm...> wrote: >> Hello all, >> >> Is there a way to tell MPL that something I plotted (like a series of >> Line2D, to create a grid) should not be considered for the legend? >> >> I'm plotting a lot of things, and because of these objects (without >> label), I always got these msgs: >> >> /usr/lib/pymodules/python2.6/matplotlib/axes.py:4014: UserWarning: No >> labeled objects found. Use label='...' kwarg on individual plots. >> warnings.warn("No labeled objects found. " >> > I always use the following set of commands to get costumize my legend: > > ************************************** > legendEntries=[] # list of plots that are going to be in > the legend > legendText=[] # list of text messages for the legend > > thisPlot = plot(x,y,'b*') # a plot command > > legendEntries.append(thisPlot) # only do this for the plots you want > to add to the legend > legendText.append("legend text") # only this for the plots you want > to add to the legend > > lgd = legend(legendEntries,legendText,numpoints=1,prop=props,loc='upper > right') # example of how to draw the legend > > ************************************** > > Hope this helps, > > Tinne > -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano http://lattes.cnpq.br/5846052449613692 Linux User #89721 ________________ Can’t stop the signal. |
From: Benjamin R. <ben...@ou...> - 2010-08-26 15:50:23
|
On Thu, Aug 26, 2010 at 9:39 AM, Daπid <dav...@gm...> wrote: > Image Magick and Inkscape seem to work for this. Probably the first > one is easier to automatize in batch processing. > > Quick warning about ImageMagick and EPS files (and any other vector-based graphics format)... ImageMagick is a raster-based system. When it loads a vector-based graphic, it implicitly rasterizes it, performs the requested operations, and then outputs the file format. So, even if you output the result as a EPS file, you would have lost all vector-based info (like text and lines). The result looks horrible. I have been contemplating adding some sort of functionality like this for the various formats. I recently ran into issues like this for an IEEE publication and had to resort to obtaining a copy of Adobe Acrobat Pro to fix up my images. It would be nice if I could pass an option to .savefig() like 'use_cmyk=True' or something and be done with it. Ben Root |
From: Benjamin R. <ben...@ou...> - 2010-08-26 15:40:26
|
On Thu, Aug 26, 2010 at 6:55 AM, xyz <mi...@op...> wrote: > Hello, > What is the best way to create an automatically optimal size for picture > with figsize? > > from pylab import * > import matplotlib.pyplot as plt > > x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, > 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] > y1 = [20, 24, 8, 4, 12, 22, 31, 25, 15, 28, 12, 27, 22, 22, 27, 14, 32, > 28, 8, 17, 2, 8, 29, 13, 14, 20, 11, 28, 8] > point_labels1 = ['A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', > 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', > 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', > 'A=1'] > > #fig = plt.figure(figsize=(40,40)) > ax = fig.add_subplot(111) > > ax.set_title('The red point should be on the path') > > plt.plot(x, y1, 'bo', x, y2, 'go') > ax.grid(True) > > # rotates and right aligns the x labels, and moves the bottom of the > # axes up to make room for them > fig.autofmt_xdate() > > # set x and y labels > plt.xticks(range(0, 40, 1)) > > #ax.set_xticks(4.5) > plt.yticks(range(0, 40, 1)) > plt.xlabel('Longitude') > plt.ylabel('Latitude') > plt.legend(('Model length', 'Data length'), > 'best', shadow=True, fancybox=True) > > for i, label in enumerate(y1): > plt.text (x[i], y1[i]+0.2, label, > horizontalalignment='center' ) > > plt.show() > > Thank you in advance. > > Maybe the .set_aspect() function can help you? http://matplotlib.sourceforge.net/api/axes_api.html?highlight=set_aspect#matplotlib.axes.Axes.set_aspect I should point out that there has been some changes to set_aspect(), so if you are not using version 1.0 of mpl, then you need to check your version of the documentation. I hope that helps! Ben Root |
From: Benjamin R. <ben...@ou...> - 2010-08-26 15:16:42
|
On Thu, Aug 26, 2010 at 12:46 AM, David Pine <dj...@gm...> wrote: > Ben, > > Ok, thanks, I can do that. Still, I would like to understand better how > matplotlib is works --- the animation calls remain somewhat mysterious to > me. About the only documentation I can find is that contained in the > example files, and that is pretty cryptic. Is there any other place where > the calls and techniques used in these animations are described in greater > detail? > > Dave > > Dave, I agree that the animation calls are very cryptic. Luckily, Ryan May has done an excellent job of creating a matplotlib module that simplifies that process significantly. Last night, he uploaded his work onto the official development branch. It might be some time before you see it in an official release of matplotlib. However, if you are feeling adventurous, you can checkout the development branch from the sourceforge repository and try it yourself. Feedback would be greatly welcome. http://matplotlib.sourceforge.net/faq/installing_faq.html#install-svn http://matplotlib.sourceforge.net/users/installing.html#installing-from-source Ben Root |
From: Michele De S. <mic...@gm...> - 2010-08-26 14:44:25
|
Thanks. I think it will be useful to have "cookbook instructions" to perform this task on the Matplotlib web site. Meanwhile, is there anyone that can provide those instructions, please (I've not any of these tools installed yet, and I don't know them). ? 2010/8/26 Daπid <dav...@gm...>: > Image Magick and Inkscape seem to work for this. Probably the first > one is easier to automatize in batch processing. > > On Thu, Aug 26, 2010 at 4:21 PM, Michael Droettboom <md...@st...> wrote: >> matplotlib does not have any built-in support for any color spaces other >> than RGB. You would need to use an external tool (if such a thing >> exists) to convert color spaces. >> >> Mike >> >> On 08/26/2010 10:06 AM, Michele De Stefano wrote: >>> Is it possible to export EPS images with the CMYK color scheme ? >>> >>> There are several technical journals that require this format (for >>> example Geophysiscs, one of the most important geophysical journals, >>> The Leading Edge, and, I think, Geophysical Prospecting only to cite >>> some of them). >>> >>> >> >> >> -- >> Michael Droettboom >> Science Software Branch >> Space Telescope Science Institute >> Baltimore, Maryland, USA >> >> >> ------------------------------------------------------------------------------ >> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program >> Be part of this innovative community and reach millions of netbook users >> worldwide. Take advantage of special opportunities to increase revenue and >> speed time-to-market. Join now, and jumpstart your future. >> http://p.sf.net/sfu/intel-atom-d2d >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michele De Stefano http://www.linkedin.com/in/micdestefano http://code.google.com/p/mds-utils http://micheledestefano.xoom.it |
From: Daπid <dav...@gm...> - 2010-08-26 14:39:45
|
Image Magick and Inkscape seem to work for this. Probably the first one is easier to automatize in batch processing. On Thu, Aug 26, 2010 at 4:21 PM, Michael Droettboom <md...@st...> wrote: > matplotlib does not have any built-in support for any color spaces other > than RGB. You would need to use an external tool (if such a thing > exists) to convert color spaces. > > Mike > > On 08/26/2010 10:06 AM, Michele De Stefano wrote: >> Is it possible to export EPS images with the CMYK color scheme ? >> >> There are several technical journals that require this format (for >> example Geophysiscs, one of the most important geophysical journals, >> The Leading Edge, and, I think, Geophysical Prospecting only to cite >> some of them). >> >> > > > -- > Michael Droettboom > Science Software Branch > Space Telescope Science Institute > Baltimore, Maryland, USA > > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: John H. <jd...@gm...> - 2010-08-26 14:34:09
|
On Wed, Aug 25, 2010 at 10:47 PM, dcarroll <spa...@gm...> wrote: > > I am trying make a plot that is in a loop and replots when new data is > updated. > > #IN A LOOP > > fig = plt.figure(1,[10,10]) > fig.clf It looks like the problem is that you are not clearing your figure. clf is a function, so you need fig.clf() JDH |
From: Michael D. <md...@st...> - 2010-08-26 14:21:43
|
matplotlib does not have any built-in support for any color spaces other than RGB. You would need to use an external tool (if such a thing exists) to convert color spaces. Mike On 08/26/2010 10:06 AM, Michele De Stefano wrote: > Is it possible to export EPS images with the CMYK color scheme ? > > There are several technical journals that require this format (for > example Geophysiscs, one of the most important geophysical journals, > The Leading Edge, and, I think, Geophysical Prospecting only to cite > some of them). > > -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA |
From: Michele De S. <mic...@gm...> - 2010-08-26 14:13:51
|
Is it possible to export EPS images with the CMYK color scheme ? There are several technical journals that require this format (for example Geophysiscs, one of the most important geophysical journals, The Leading Edge, and, I think, Geophysical Prospecting only to cite some of them). -- Michele De Stefano http://www.linkedin.com/in/micdestefano http://code.google.com/p/mds-utils http://micheledestefano.xoom.it |
From: Ryan M. <rm...@gm...> - 2010-08-26 13:41:53
|
On Thu, Aug 26, 2010 at 6:18 AM, xyz <mi...@op...> wrote: > On 26/08/10 01:15, Benjamin Root wrote: >> I believe you are asking why the x axis starts at 2? This is because >> matplotlib will automatically set the limits of your plot to show all >> of your data. If you can control the axes yourself by calling >> set_xlim() and/or set_ylim(). >> >> ax.set_xlim(0.0, 5.0) >> >> would set the limits of your x axis to 0.0 and 5.0. You can also do >> >> ax.set_xlim(left=0.0) >> >> to control only the left end of the axis (letting the right end be >> automatically set). >> >> I hope that helps! >> Ben Root > Thank you it works, but ax.set_xlim(left=0.0) does not work only > ax.set_xlim(0.0) works. That's becaues that only works for SVN trunk. The keyword args 'left' and 'right' have been added as synonyms for xmin and xmax, respectively. For your release, try: ax.set_xlim(xmin=0.0) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
From: Ryan M. <rm...@gm...> - 2010-08-26 13:36:49
|
On Thu, Aug 26, 2010 at 1:55 AM, Tinne De Laet <tin...@me...> wrote: > Hi Carlos, > > On Thu, Aug 26, 2010 at 04:49, Carlos Grohmann > <car...@gm...> wrote: >> Hello all, >> >> Is there a way to tell MPL that something I plotted (like a series of >> Line2D, to create a grid) should not be considered for the legend? >> >> I'm plotting a lot of things, and because of these objects (without >> label), I always got these msgs: >> >> /usr/lib/pymodules/python2.6/matplotlib/axes.py:4014: UserWarning: No >> labeled objects found. Use label='...' kwarg on individual plots. >> warnings.warn("No labeled objects found. " >> > I always use the following set of commands to get costumize my legend: > > ************************************** > legendEntries=[] # list of plots that are going to be in > the legend > legendText=[] # list of text messages for the legend > > thisPlot = plot(x,y,'b*') # a plot command > > legendEntries.append(thisPlot) # only do this for the plots you want > to add to the legend > legendText.append("legend text") # only this for the plots you want > to add to the legend > > lgd = legend(legendEntries,legendText,numpoints=1,prop=props,loc='upper > right') # example of how to draw the legend > > ************************************** You can also leave out the label, or in a loop like this, conditionally assign a label of '_nolegend_', which suppresses adding it to the legend. This example shows how the different options work: import numpy as np import matplotlib.pyplot as plt x1,y1 = np.random.rand(2,10) x2,y2 = np.random.rand(2,10) x3,y3 = np.random.rand(2,10) x4,y4 = np.random.rand(2,10) plt.plot(x1, y1, label='first') plt.plot(x2, y2) # No label, so not included plt.plot(x3, y3, label='_nolegend_') # Actively suppress plt.plot(x4, y4, label='fourth') plt.legend() # Only shows lines 'first' and 'fourth' Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
From: Ryan M. <rm...@gm...> - 2010-08-26 13:36:01
|
On Thu, Aug 26, 2010 at 8:23 AM, Tinne De Laet <tin...@me...> wrote: > On Thu, Aug 26, 2010 at 05:47, dcarroll <spa...@gm...> wrote: >> >> I am trying make a plot that is in a loop and replots when new data is >> updated. >> >> #IN A LOOP >> >> fig = plt.figure(1,[10,10]) >> fig.clf >> >> prop = matplotlib.font_manager.FontProperties(size=8) >> >> xMin = dates[1] >> xMax = dates[-1] >> >> #temperature plot >> yMin = min(temperatureSQLData) >> yMax = max(temperatureSQLData) >> >> minTemperature = "Min = %.3f " % min(temperatureSQLData) + 'deg ' + 'C' >> minTemperatureIndex = temperatureSQLData.index(yMin) >> >> maxTemperature = "Max = %.3f " % max(temperatureSQLData) + 'deg ' + 'C' >> maxTemperatureIndex = temperatureSQLData.index(yMax) >> >> ax1 = fig.add_subplot(511) >> ax1.cla >> >> plt.hold(True) >> plt.plot(dates,temperatureSQLData,'r') >> plt.plot(dates[minTemperatureIndex],yMin,'ro',label=minTemperature) >> plt.plot(dates[maxTemperatureIndex],yMax,'bo',label=maxTemperature) >> plt.hold(False) >> >> plt.title("Water Conditions for the last 7 Days.") >> >> plt.xlim([xMin,xMax]) >> plt.ylim([yMin-1,yMax+1]) >> plt.ylabel('Temperature') >> ax1.legend(numpoints=1,prop=prop) >> >> dateFormat = mpl.dates.DateFormatter('%m/%d/%Y') >> ax1.xaxis.set_major_formatter(dateFormat) >> daysLocation = mpl.dates.DayLocator() >> ax1.xaxis.set_major_locator(daysLocation) >> hoursLocation = mpl.dates.HourLocator(interval=4) >> ax1.xaxis.set_minor_locator(hoursLocation) >> >> The problem is that the number of items in my legend grows with each >> iteration of the loop. Any help would be appreciated! > > > > You can select yourself what you want to include in the legend by > creating the legend as follows: You can also leave out the label, or in a loop like this, conditionally assign a label of '_nolegend_', which suppresses adding it to the legend. This example shows how the different options work: import numpy as np import matplotlib.pyplot as plt x1,y1 = np.random.rand(2,10) x2,y2 = np.random.rand(2,10) x3,y3 = np.random.rand(2,10) x4,y4 = np.random.rand(2,10) plt.plot(x1, y1, label='first') plt.plot(x2, y2) # No label, so not included plt.plot(x3, y3, label='_nolegend_') # Actively suppress plt.plot(x4, y4, label='fourth') plt.legend() # Only shows lines 'first' and 'fourth' Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
From: Tinne De L. <tin...@me...> - 2010-08-26 13:23:44
|
Hi , On Thu, Aug 26, 2010 at 05:47, dcarroll <spa...@gm...> wrote: > > I am trying make a plot that is in a loop and replots when new data is > updated. > > #IN A LOOP > > fig = plt.figure(1,[10,10]) > fig.clf > > prop = matplotlib.font_manager.FontProperties(size=8) > > xMin = dates[1] > xMax = dates[-1] > > #temperature plot > yMin = min(temperatureSQLData) > yMax = max(temperatureSQLData) > > minTemperature = "Min = %.3f " % min(temperatureSQLData) + 'deg ' + 'C' > minTemperatureIndex = temperatureSQLData.index(yMin) > > maxTemperature = "Max = %.3f " % max(temperatureSQLData) + 'deg ' + 'C' > maxTemperatureIndex = temperatureSQLData.index(yMax) > > ax1 = fig.add_subplot(511) > ax1.cla > > plt.hold(True) > plt.plot(dates,temperatureSQLData,'r') > plt.plot(dates[minTemperatureIndex],yMin,'ro',label=minTemperature) > plt.plot(dates[maxTemperatureIndex],yMax,'bo',label=maxTemperature) > plt.hold(False) > > plt.title("Water Conditions for the last 7 Days.") > > plt.xlim([xMin,xMax]) > plt.ylim([yMin-1,yMax+1]) > plt.ylabel('Temperature') > ax1.legend(numpoints=1,prop=prop) > > dateFormat = mpl.dates.DateFormatter('%m/%d/%Y') > ax1.xaxis.set_major_formatter(dateFormat) > daysLocation = mpl.dates.DayLocator() > ax1.xaxis.set_major_locator(daysLocation) > hoursLocation = mpl.dates.HourLocator(interval=4) > ax1.xaxis.set_minor_locator(hoursLocation) > > The problem is that the number of items in my legend grows with each > iteration of the loop. Any help would be appreciated! You can select yourself what you want to include in the legend by creating the legend as follows: ************************************** legendEntries=[] # list of plots that are going to be in the legend legendText=[] # list of text messages for the legend thisPlot = plot(x,y,'b*') # a plot command legendEntries.append(thisPlot) # only do this for the plots you want to add to the legend legendText.append("legend text") # only this for the plots you want to add to the legend lgd = legend(legendEntries,legendText,numpoints=1,prop=props,loc='upper right') # example of how to draw the legend ************************************** so you could clean the legendEntries and legendText at the beginning of every loop by calling legendEntries=[] legendText=[] Or if the legend is every time the same you can only create it in the first iteration of the loop and then do not change the legendEntries or legendtext any more. Tinne |
From: xyz <mi...@op...> - 2010-08-26 11:55:34
|
Hello, What is the best way to create an automatically optimal size for picture with figsize? from pylab import * import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] y1 = [20, 24, 8, 4, 12, 22, 31, 25, 15, 28, 12, 27, 22, 22, 27, 14, 32, 28, 8, 17, 2, 8, 29, 13, 14, 20, 11, 28, 8] point_labels1 = ['A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1'] #fig = plt.figure(figsize=(40,40)) ax = fig.add_subplot(111) ax.set_title('The red point should be on the path') plt.plot(x, y1, 'bo', x, y2, 'go') ax.grid(True) # rotates and right aligns the x labels, and moves the bottom of the # axes up to make room for them fig.autofmt_xdate() # set x and y labels plt.xticks(range(0, 40, 1)) #ax.set_xticks(4.5) plt.yticks(range(0, 40, 1)) plt.xlabel('Longitude') plt.ylabel('Latitude') plt.legend(('Model length', 'Data length'), 'best', shadow=True, fancybox=True) for i, label in enumerate(y1): plt.text (x[i], y1[i]+0.2, label, horizontalalignment='center' ) plt.show() Thank you in advance. |