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
(5) |
3
(18) |
4
(9) |
5
(13) |
6
(14) |
7
(8) |
8
(7) |
9
(6) |
10
(6) |
11
(24) |
12
(14) |
13
(9) |
14
(21) |
15
(6) |
16
(1) |
17
(20) |
18
(42) |
19
(16) |
20
(21) |
21
(41) |
22
(13) |
23
(11) |
24
(15) |
25
(32) |
26
(27) |
27
(29) |
28
(10) |
29
(3) |
30
(1) |
31
(5) |
|
|
|
|
|
Hi Alex, [I'm cc:ing the matplotlib-users list again.] >> could you post a screenshot from your pdf viewer? > > I put some up at these URLs: In the screenshots the problem is obvious. I didn't see it in either Apple's Preview or Adobe Reader, but I do see it in xpdf. The problem is that the graphics state stack is not always popped at the end of the file. I believe I have fixed the problem in the latest svn versions, both on the maintenance branch and on the trunk. Please try the latest version with your code. -- Jouni K. Seppänen http://www.iki.fi/jks
Hello windows users - Can anybody using mpl 0.91.2 on windows reproduce this bug: from pylab import * plot([1,2,3]) xlabel(r'$\chi$') savefig('c:/temp/test.eps') This should give an eps file that when viewed does not show the letter chi along the x-axis (that's the bug). We have been discussing this problem, and I think it is a bug in the windows distribution. (It worked on all the previous mpl versions fine, just when upgrading from 0.90.1 the problem arose). If you can, please email me your eps file: ma...@gm... Thanks for your help, Mark
Tiago Ribeiro wrote: > Hi, > > I'm running a vanilla copy of Mac OS X 10.5.2 and just installed > matplotlib-0.91.2, geos-2.2.3 and baselib-0.9.9.1 from their sources. > The matplotlib examples work fine, but when trying to import baselib, > it says it cannot find it: > > >>> from matplotlib.toolkits.basemap import Basemap > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: No module named basemap > >>> > > Any idea of what could be happening? The lib is definitively on my > path (/Library/Python/2.5/site-packages/) > > Best, > > Tiago > > > Tiago: This will happen if matplotlib is installed as an egg, due to a bug in the way toolkits are installed. Do you see a matplotlib*egg file in /Library/Python/2.5/site-packages/ ? If so, all I can suggest is reinstalling matplotlib the 'normal' way, i.e. python setup.py install. This bug is fixed in svn so this won't happen with the next release. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328
I'm happy to report that the egg install is now working. Still not able to get the source to compile but I can live with that. The problem appears to be the fink versions of libJPEG and libTIFF. When I removed /sw/libJPEG, the installation crashed with a similar error on libTIFF. When I removed /sw/libTIFF (fink remove libTIFF) the egg install (sudo easy_install matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg) worked. The last thing I had to do was change the ownership and permissions of my ~/ .matplotlib from root to me, and simple plot commands are now working. Now, some people may need their fink /sw versions of libJPEG and libTIFF - are there commands that you can pass to easy_install to instruct it to link against the default installed libJPEG and libTIFFs? Cheers, Andrew
Hi everyone, I am using matplotlib to dynamically plot a graph with both my x and y points taken from a measurement device. That is to say, in each iteration of my while loop I'm reading two variables which I then want to plot with matplotlib. I wrote something which goes like this (disregard the Gnuplot - that's what I'm trying to replace with matplotlib...) import gpib, Numeric, time, Gnuplot, mymodule, threading from pylab import * def cooldown(filename, dmm_gpib, lake_gpib): """this program scans dummy and reads HP and Lakeshore""" A = Numeric.arange(-1, 1, .1) delay = 1 f = open(filename,'w') X = [] Y = [] figure(2) hold(False) try: while A[0]<10: gpib.write(lake_fd, 'SDAT?') gpib.write(hp_fd, 'read?') time.sleep(delay) val1 = float(gpib.read(lake_fd, 30)) val2 = float(gpib.read(hp_fd, 30)) X.append(val1) Y.append(val2) plot(X,Y,'.-') f.write(str(val1) + '\t' + str(val2) + '\n') f.flush() I'm running this code in ipython with the -pylab option, so I don't need to use show(). My question is, how do I maintain a *constant* xlabel and ylabel without having to redraw them each time I append a point to the graph? If I try xlabel('something') then obviously it's cleared each time I use plot(X,Y). Any ideas? Thanks, Amit.
On Fri, Mar 21, 2008 at 9:39 AM, Pierre GM <pgm...@gm...> wrote: > On Thursday 20 March 2008 23:39:53 you wrote: > > Pierre, > > > > I was interested in learning more about TimeSeries, and had a few > > questions... > > > > Your data is indexed in time, right ? Your x-axis is a date object ? > > > > > > Just to be clear on the language: "indexed in time" means data for > which > > the x-axis is a series of dates, correct? But I am not sure what is > meant > > by the "x-axis being a date object" --wouldn't it be a axis object with > the > > values comprising it being date objects? I'm not trying to split hairs, > > I'm just unclear about the way this is typically described and it would > be > > useful for me to be clear about it. > > Sorry, I wasn't clear enough: by x-axis, I was not referring to any python > object, but generic abscissae, as in "plot rain vs time". > By indexed in time, I mean that you would have something like: > yourdata[one_date] = some_value > > That's what scikits.timeseries was designed to do: handle data indexed in > time, giving the possibility to access the data directly by dates (instead > of > using an index in an array). We made sure we could handle gaps in your > data > (viz, data not regularly spaced in time...) > > > I've looked at the link. Could you explain what TimeSeries does that > the > > mpl modules dates and dateutil don't do, or when one would use one > versus > > the other? > > Not so much useful for plotting (even if there are some cool tricks) than > for > simplifying the analysis of your data: getting for example monthly > averages > from daily data is a breeze > > > For my part, I need to simply plot values with dates (and yes with some > > dates missing no doubt) as the x-axis and am looking for various ways to > do > > it well. > > You can just stick to mpl, using plot_dates instead of plot. But you may > want > to give timeseries a try. > > > Thank you. > I will certainly give it a try, it sounds like it could really add to what I want to do. Thanks! I'll be in touch if I have questions about timeseries.
Hi, I'm running a vanilla copy of Mac OS X 10.5.2 and just installed matplotlib-0.91.2, geos-2.2.3 and baselib-0.9.9.1 from their sources. The matplotlib examples work fine, but when trying to import baselib, it says it cannot find it: >>> from matplotlib.toolkits.basemap import Basemap Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named basemap >>> Any idea of what could be happening? The lib is definitively on my path (/Library/Python/2.5/site-packages/) Best, Tiago
C M wrote: > [...] > > I don't have your answer, but for what it's worth, this aspect of not > having a way to have a graph with just the left and bottom axes and no > right and top lines--in fact, not having it as either the default or a > very easy flag to set in making graphs--rather surprised me too when I > encountered matplotlib. Many of the figures I've encountered in biology > do not have this enclosing box around it in this way. > > Would it be something that could be added in future editions of matplotlib? Yes. It should be easy, and it is a common request. Eric
On Sat, Mar 22, 2008 at 5:05 PM, Rich Shepard <rsh...@ap...> wrote: > It was suggested that a work-around to allow only the left and bottom > axes > is to turn off the plot frame and use axhline and axvline instead. When I > try this, the axes are extended left and below the origin of the lines. I > don't see a kwarg to turn this off. > > Two sample plots are attached. > > Having a plot framed on all four sides may be unusual -- in my areas of > science anyway -- but could be acceptable except when the plotted curves > are > trapezoids, and left-/right-shouldered curves. Then the top of the curve > is > overlain by the frame and cannot be seen. > > Please let me know what magic incantations will allow me to plot curves > using axhline and axvline as the actual axes (or frame if you will). > > Rich > > -- > Richard B. Shepard, Ph.D. | Integrity > Credibility > Applied Ecosystem Services, Inc. | Innovation > <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: > 503-667-8863 > I don't have your answer, but for what it's worth, this aspect of not having a way to have a graph with just the left and bottom axes and no right and top lines--in fact, not having it as either the default or a very easy flag to set in making graphs--rather surprised me too when I encountered matplotlib. Many of the figures I've encountered in biology do not have this enclosing box around it in this way. Would it be something that could be added in future editions of matplotlib?
It was suggested that a work-around to allow only the left and bottom axes is to turn off the plot frame and use axhline and axvline instead. When I try this, the axes are extended left and below the origin of the lines. I don't see a kwarg to turn this off. Two sample plots are attached. Having a plot framed on all four sides may be unusual -- in my areas of science anyway -- but could be acceptable except when the plotted curves are trapezoids, and left-/right-shouldered curves. Then the top of the curve is overlain by the frame and cannot be seen. Please let me know what magic incantations will allow me to plot curves using axhline and axvline as the actual axes (or frame if you will). Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
On 2008年3月22日, Rich Shepard wrote: > Issue #1: I am apparently not properly closing/clearing a plot. There are > three plots in the test data set, and when the last one (with three curves > on a common set of axes) is the only one plotted, it is correctly done. But, > when it follows the 2-curve plots, they are also displayed. Fixed: I discovered .close() and added that to the end of each plot's content. Still need advice on #2. > Issue #2: Is there a way to define the parameters for the Gaussian curve > so the end points are actually 0.0 on the y axis while the mid point is as > specified? Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
Hi. I've seen this problem before. I think that you need to install freetype developer. The easiest way to install this is with macports and then type "port install freetype" On Mar 21, 2008, at 9:50 PM, Andrew Charles wrote: > Yes it was the matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg I tried to > install. I've posted the entire easy_install output below. I'll let > the list know if i resolve the problem. > > Andrew > > --------------------------------------------------- > > Processing matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg > creating /Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg > Extracting matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg to > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- > packages > Adding matplotlib 0.91.2 to easy-install.pth file > > Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg > Processing dependencies for matplotlib==0.91.2 > Searching for matplotlib==0.91.2 > Reading http://pypi.python.org/simple/matplotlib/ > Reading http://matplotlib.sourceforge.net > Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 > Reading http://sourceforge.net/project/showfiles.php?group_id=80706 > Best match: matplotlib 0.91.2 > Downloading http://downloads.sourceforge.net/matplotlib/matplotlib-0.91.2.tar.gz?modtime=1199627250&big_mirror=0 > Processing matplotlib-0.91.2.tar.gz > Running matplotlib-0.91.2/setup.py -q bdist_egg --dist-dir > /tmp/easy_install-QGmbAu/matplotlib-0.91.2/egg-dist-tmp-hsIe8R > = > = > = > = > = > = > ====================================================================== > BUILDING MATPLOTLIB > matplotlib: 0.91.2 > python: 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC > 4.0.1 (Apple Computer, Inc. build 5363)] > platform: darwin > > REQUIRED DEPENDENCIES > numpy: 1.0.5.dev4897 > freetype2: 9.16.3 > > OPTIONAL BACKEND DEPENDENCIES > libpng: 1.2.24 > Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 > wxPython: no > * wxPython not found > Gtk+: no > * Building for Gtk+ requires pygtk; you must > be able > * to "import gtk" in your build/install > environment > Qt: no > Qt4: no > Cairo: no > > OPTIONAL DATE/TIMEZONE DEPENDENCIES > datetime: present, version unknown > dateutil: matplotlib will provide > pytz: matplotlib will provide > > OPTIONAL USETEX DEPENDENCIES > dvipng: no > ghostscript: 8.57 > latex: no > > EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES > configobj: matplotlib will provide > enthought.traits: matplotlib will provide > > [Edit setup.cfg to suppress the above messages] > = > = > = > = > = > = > ====================================================================== > warning: no files found matching 'NUMARRAY_ISSUES' > warning: no files found matching 'MANIFEST' > warning: no files found matching 'matplotlibrc' > warning: no files found matching 'lib/matplotlib/toolkits' > no previously-included directories found matching 'examples/_tmp_*' > In file included from > /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ > Python.h:8, > from ./CXX/WrapPython.h:47, > from ./CXX/Extensions.hxx:48, > from src/ft2font.h:18, > from src/ft2font.cpp:2: > /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ > pyconfig.h:814:1: > warning: "SIZEOF_LONG" redefined > In file included from /usr/X11/include/freetype2/freetype/freetype.h: > 41, > from src/ft2font.h:12, > from src/ft2font.cpp:2: > /usr/X11/include/freetype2/freetype/config/ftconfig.h:65:1: warning: > this is the location of the previous definition > In file included from > /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ > Python.h:8, > from ./CXX/WrapPython.h:47, > from ./CXX/Extensions.hxx:48, > from src/ft2font.h:18, > from src/ft2font.cpp:2: > /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ > pyconfig.h:814:1: > warning: "SIZEOF_LONG" redefined > In file included from /usr/X11/include/freetype2/freetype/freetype.h: > 41, > from src/ft2font.h:12, > from src/ft2font.cpp:2: > /usr/X11/include/freetype2/freetype/config/ftconfig.h:65:1: warning: > this is the location of the previous definition > In file included from /usr/include/math.h:26, > from > /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ > pyport.h:231, > from > /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ > Python.h:57, > from ./CXX/WrapPython.h:47, > from CXX/cxxextensions.c:38: > /usr/include/architecture/ppc/math.h:675: warning: conflicting types > for built-in function ‘scalb’ > ld: in /sw/lib/libJPEG.dylib, file is not of required architecture for > architecture ppc > collect2: ld returned 1 exit status > lipo: can't open input file: /var/tmp//ccG9WQI9.out (No such file or > directory) > error: Setup script exited with error: command 'g++' failed with > exit status 1 > Exception exceptions.OSError: (2, 'No such file or directory', > 'src/image.cpp') in <bound method CleanUpFile.__del__ of > <setupext.CleanUpFile instance at 0x1b5f4b8>> ignored > Exception exceptions.OSError: (2, 'No such file or directory', > 'src/transforms.cpp') in <bound method CleanUpFile.__del__ of > <setupext.CleanUpFile instance at 0x1b5ccd8>> ignored > Exception exceptions.OSError: (2, 'No such file or directory', > 'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of > <setupext.CleanUpFile instance at 0x1b5f030>> ignored > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
On 2008年3月21日, John Hunter apparently wrote: > The source and accompanying code that generates the > figures are found in the "doc" subdirectory of the svn > trunk > [Attachment: artist_api_tut.txt : TEXT/PLAIN, 510 lines] > [Attachment: event_handling_tut.txt : TEXT/PLAIN, 361 lines] 1. Hoping you will point to this from somewhere users are more likely to find. 2. Has anyone actually complained about the use of getters and setters? I've found it a friendly (i.e., predictable) interface. Anyway, if you add properties, I hope that these will remain (instead of, say, just using the property and propset decorators). Cheers, Alan Isaac
Simson Garfinkel wrote: > Dear Francesco, > > I'm sorry --- it is hard not to read your message and laugh. You > really think that the static type checking of C++ is protecting you? > Well, it may be, but C++ is unsafe in so many other ways that you are > not doing yourself a favor by working in it. > > If you want to use a typesafe language, you really should be using > Java or Python. Java will give you both static and dynamic type > checking. Python will give you runtime type checking. C++ gives you a > good feeling until something goes wrong and it crashes. > It is certainly possible to shoot yourself in the foot with C++ if you use it like it were plain C (i.e., unsafe casts, casts to void *, pointers to functions, etc.). However the C++ programming style which is sometimes referred to as "modern" C++ (cfr. Alexandrescu's book), which makes heavy use of template (meta)programming facilities, shields you very effectively from such problems. For example, you can use functors in place of pointers to functions, and if you do something wrong the compiler will error out (in place of random crashes at runtime). If I write a generic template function which requires that its argument supports a certain method, and if I use it with an argument type that does not provide such method, a compilation error will be emitted. You can use the static_cast operator to make sure at compile time that you are not performing a "dangerous" cast. And so on... Frankly, the only cases in which I usually have to resort to the pains of plain C programming are when fiddling with lower level stuff like memory allocators, SIMD programming, etc. But usually you just have to encapsulate a small amount of dangerous code into a class and provide some abstraction to interact with it and you are done. I write mostly scientific software, so abandoning C++ tout-court is not an option. Thanks to all who replied, and best regards. Francesco.
I have three unresolved issues in the attached code, and I'd like to resolve the first two on this thread. (The third issue relates to plotting using only the left and bottom axes rather than a complete frame.) Issue #1: I am apparently not properly closing/clearing a plot. There are three plots in the test data set, and when the last one (with three curves on a common set of axes) is the only one plotted, it is correctly done. But, when it follows the 2-curve plots, they are also displayed. I probably am turning .hold() off and on in the wrong places, but I don't know where the right places are. On a side note, if I try to use plot.hold() to toggle the hold state off python throws an error. I need to explicitly use plot.hold(False). Issue #2: Is there a way to define the parameters for the Gaussian curve so the end points are actually 0.0 on the y axis while the mid point is as specified? Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
Alex Coventry <thr...@MI...> writes: > I'm trying to use some matplotlib-generated pdfs in a pdflatex document, > and seeing some extremely weird and disruptive size effects. Could you be more specific about what the problem seems to be? I looked at your pdf files, and it looks like pdflatex is taking your eight-inch wide figure (including the margins) and scaling it to 6 in. The space between the margins is about 4.8 in, so of course the figure doesn't fit, and because it has empty margins on every side, it kind of looks like it has been translated away from where it belongs. If this is not what you are seeing, could you post a screenshot from your pdf viewer? Do you mean to ask how you can make the figure take up exactly the space between the margins in your document? In that case my recommendation is to build up the figure to the correct width from the start, e.g. figure(figsize=(4.8,4.8)) or whatever the correct size is, and avoid doing any kind of resizing with \includegraphics. Create your axes explicitly instead of relying on the default (which reserves ample margins on every side in case you want to put a title on top, etc). Start with something like axes([0.1,0.1,0.9,0.9]) -- the numbers are left, bottom, width, height, so to remove the margin on the right make sure left+width=1.0. You will have to tweak this to make just enough room for your axis labels. > If I generate postscript files with matplotlib and convert > them to pdfs, I don't get this problem. Probably some step in this pipeline recomputes the bounding box for the figure from the ink on the page, so the margins disappear. -- Jouni K. Seppänen http://www.iki.fi/jks
Yes it was the matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg I tried to install. I've posted the entire easy_install output below. I'll let the list know if i resolve the problem. Andrew --------------------------------------------------- Processing matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg creating /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg Extracting matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg to /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages Adding matplotlib 0.91.2 to easy-install.pth file Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg Processing dependencies for matplotlib==0.91.2 Searching for matplotlib==0.91.2 Reading http://pypi.python.org/simple/matplotlib/ Reading http://matplotlib.sourceforge.net Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 Reading http://sourceforge.net/project/showfiles.php?group_id=80706 Best match: matplotlib 0.91.2 Downloading http://downloads.sourceforge.net/matplotlib/matplotlib-0.91.2.tar.gz?modtime=1199627250&big_mirror=0 Processing matplotlib-0.91.2.tar.gz Running matplotlib-0.91.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-QGmbAu/matplotlib-0.91.2/egg-dist-tmp-hsIe8R ============================================================================ BUILDING MATPLOTLIB matplotlib: 0.91.2 python: 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] platform: darwin REQUIRED DEPENDENCIES numpy: 1.0.5.dev4897 freetype2: 9.16.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.24 Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 wxPython: no * wxPython not found Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to "import gtk" in your build/install environment Qt: no Qt4: no Cairo: no OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: matplotlib will provide pytz: matplotlib will provide OPTIONAL USETEX DEPENDENCIES dvipng: no ghostscript: 8.57 latex: no EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES configobj: matplotlib will provide enthought.traits: matplotlib will provide [Edit setup.cfg to suppress the above messages] ============================================================================ warning: no files found matching 'NUMARRAY_ISSUES' warning: no files found matching 'MANIFEST' warning: no files found matching 'matplotlibrc' warning: no files found matching 'lib/matplotlib/toolkits' no previously-included directories found matching 'examples/_tmp_*' In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8, from ./CXX/WrapPython.h:47, from ./CXX/Extensions.hxx:48, from src/ft2font.h:18, from src/ft2font.cpp:2: /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:814:1: warning: "SIZEOF_LONG" redefined In file included from /usr/X11/include/freetype2/freetype/freetype.h:41, from src/ft2font.h:12, from src/ft2font.cpp:2: /usr/X11/include/freetype2/freetype/config/ftconfig.h:65:1: warning: this is the location of the previous definition In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8, from ./CXX/WrapPython.h:47, from ./CXX/Extensions.hxx:48, from src/ft2font.h:18, from src/ft2font.cpp:2: /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:814:1: warning: "SIZEOF_LONG" redefined In file included from /usr/X11/include/freetype2/freetype/freetype.h:41, from src/ft2font.h:12, from src/ft2font.cpp:2: /usr/X11/include/freetype2/freetype/config/ftconfig.h:65:1: warning: this is the location of the previous definition In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:231, from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:57, from ./CXX/WrapPython.h:47, from CXX/cxxextensions.c:38: /usr/include/architecture/ppc/math.h:675: warning: conflicting types for built-in function ‘scalb’ ld: in /sw/lib/libJPEG.dylib, file is not of required architecture for architecture ppc collect2: ld returned 1 exit status lipo: can't open input file: /var/tmp//ccG9WQI9.out (No such file or directory) error: Setup script exited with error: command 'g++' failed with exit status 1 Exception exceptions.OSError: (2, 'No such file or directory', 'src/image.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x1b5f4b8>> ignored Exception exceptions.OSError: (2, 'No such file or directory', 'src/transforms.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x1b5ccd8>> ignored Exception exceptions.OSError: (2, 'No such file or directory', 'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x1b5f030>> ignored
Dear Francesco, I'm sorry --- it is hard not to read your message and laugh. You really think that the static type checking of C++ is protecting you? Well, it may be, but C++ is unsafe in so many other ways that you are not doing yourself a favor by working in it. If you want to use a typesafe language, you really should be using Java or Python. Java will give you both static and dynamic type checking. Python will give you runtime type checking. C++ gives you a good feeling until something goes wrong and it crashes. On Feb 29, 2008, at 5:29 PM, Francesco Biscani wrote: > Hi all, > > Christopher Barker wrote: >> "The only difference that my users see between an app written in >> Python >> and C++ is that the Python one has more features...and fewer bugs." >> > > I'm currently working mostly in C++ and exploring integration with > Python through Boost.Python+IPython+MPL. I enjoy working in Python, > but > I'm afraid of making a more consistent switch mainly for fear of > losing > the static type checking that C++ gives me. I have the horrifying > feeling that if I were to write much code in Python I could break it > in > so many ways just because of this, and I'd have the constant > perception > of not having my back covered by the compiler, at least for this > kind of > errors. > > It's true that probably I'd get the software up and running in less > time > with Python, but I think that I would spend much more time making sure > it behaves as expected and "fortifying" it, so to speak. Am I totally > offset here? > > Francesco. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hey Matthias, Matthias Michler wrote: > maybe something like the following helps you: > ----------------------------------------------------------------------------------------- > from pylab import * > from time import sleep > > ion() # interactive mode 'on' > figure() > ax = subplot(111, autoscale_on=True) > > x, y = [0], [0] > line = plot(x, y, label="my_data")[0] > # get the line-object as the first element > # of the tuple returned by plot > legend() > for i in arange(10): > x.append(i) # append new values > y.append(i**2) > line.set_data(x,y) # reset data > ax.relim() # reset axes limits > ax.autoscale_view() # rescale axes > draw() # redraw current figure > sleep(0.5) # wait 0.5 seconds > > ioff() This is perfect, except for one little thing... My x-axis is time, and as new points are plotted, even though I'm following the above recipe pretty closely, the x-tick spacing isn't getting sorted out, so I end up with just a jumble as the tick labels for the x-axis. Do you know why this might be? > I don't know how to make this somehow interactive concerning the data input. > but maybe you save the data to a file and read them every 15 or 20 minutes. This isn't a problem, I just run in a "while True" loop and leave it running until I close the plot window. Shame I get that horrible exception when I do close the plot window, wish I knew how to make it stop :-S cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Fri, Mar 21, 2008 at 1:40 AM, Eric Firing <ef...@ha...> wrote: > > > Out of interest, how does one tell MPL to "start a new figure and forget > > everything that's gone before"? > > You can minimize the amount of package and module-level state > information by using the oo interface: see examples/agg_oo.py. If you > change any rcParams dictionary entries, typically using the rc function, > then you can restore the dictionary to its default condition with the > rcdefaults() function. I think it is comparatively rare to modify rc params within code (and never necessary since you can achieve the same by setting properties directly using the API) so if the rc params are the only global information we are using (and I am not aware of other problems off the top of my head but you might be well served to post to the antigrain mailing list to see if agg is thread safe) it shouldn't pose a serious problem. JDH
On Fri, Mar 21, 2008 at 4:18 PM, Simson Garfinkel <si...@ac...> wrote: > Is there an easy way to label bars with the value of the bar at that > point? I am doing log bars and it would be nice to have them labeled. > > I guess I can do this manually using text() and the values returned by > bar(); is there an automatic way to do it? There is nothing built in (though it would be a nice feature). Here is a simple example: import numpy as np import matplotlib.pyplot as plt N = 5 menMeans = (20, 35, 30, 35, 27) menStd = (2, 3, 4, 1, 2) ind = np.arange(N) # the x locations for the groups width = 0.35 # the width of the bars fig = plt.figure() ax = fig.add_subplot(111) rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd) womenMeans = (25, 32, 34, 20, 25) womenStd = (3, 5, 2, 3, 3) rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd) # add some ax.set_ylabel('Scores') ax.set_title('Scores by group and gender') ax.set_xticks(ind+width, ('G1', 'G2', 'G3', 'G4', 'G5') ) ax.legend( (rects1[0], rects2[0]), ('Men', 'Women') ) def autolabel(rects): # attach some text labels for rect in rects: height = rect.get_height() ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height), ha='center', va='bottom') autolabel(rects1) autolabel(rects2) #fig.savefig('barchart_demo') plt.show()
I'm trying to use some matplotlib-generated pdfs in a pdflatex document, and seeing some extremely weird and disruptive size effects. The resulting pdfs can be seen at http://research.janelia.org/coventry/paper.pdf http://research.janelia.org/coventry/paper-small.pdf The first results from the code \begin{figure} \centering \subfigure[Prior distribution]{\label{fig:prior-graph} \includegraphics[width=6in]{prior-example} } \subfigure[Posterior distribution]{\label{fig:posterior-graph} \includegraphics[width=6in]{posterior-example} } \end{figure} and the second from the same code with "width=5cm". The two pdfs I'm trying to include are at http://research.janelia.org/coventry/prior-example.pdf and http://research.janelia.org/coventry/posterior-example.pdf It doesn't matter what order I include them in, I get the same size effects. If I generate postscript files with matplotlib and convert them to pdfs, I don't get this problem. So I have a workaround, but I would like to know how to create usable pdfs directly, and thought reporting this might be useful to matplotlib development. Best, Alex
Einar M. Einarsson wrote: > Hi all, > > I'm trying to find ways to make the file-size of my PNG images smaller. > > When I generate my 660*440px image I get a big 168kb file. > (8bit RGB color model, has an alpha channel (need that) but no > interlacing scheme) > > Here it is: > http://metphys.org/eme/T05.png > > I'm using the savefig method of-course. > > > To see how much I could compress it I used pngcrush (the best tool > according to the interwebs) and got it down to 128kb. > > But thats still way to large for my intended use. (plotting results > from an operational weather model, see. www.belgingur.is > We are currently using IDL.) > > From what I've read about PNG files, which is supposed to be rather > compact image format, it seems to me that the most effective way is > to have an indexed color table. > > So to cut it short: > > Is there any way to save a PNG file with an indexed color table? Perhaps this should be supported natively in mpl; but until it is, you can do the conversion after the fact using pngquant or pngnq. Presumably, if you don't in fact have more than 256 colors, this conversion will be lossless. I have not tried this; my suggestion is based on the descriptions of pngquant and pngnq packages in Ubuntu feisty. Here is the latter: -------------------------------- tool for optimizing PNG (Portable Network Graphics) images Pngnq is a tool for quantizing 32-bit RGBA PNG images to 8-bit RGBA pallete PNG. It's is an adaptation by Stuart Coyle of Greg Roelf's pnqquant. While pngquant uses a median cut algorithm, Pngnq uses Anthony Dekker's neuquant algorithm (http://members.ozemail.com.au/~dekker/NEUQUANT.HTML), generally resulting in better looking results than pngquant. Optimizers (like pngcrush and optipng) optimize the compression, usually losslessly. pngnq quantizes colors down to 256 (or fewer) distinct RGBA combinations, which is quite lossy. Optimized PNGs are usually two to four times smaller than the 32-bit versions. Homepage: http://www.cybertherial.com/pngnq/pngnq.html ----------------------------------------------- > > Or do you see any other way to shrink the files? > > > Best regards. > Einar M. Einarsson > www.belgingur.is > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Is there an easy way to label bars with the value of the bar at that point? I am doing log bars and it would be nice to have them labeled. I guess I can do this manually using text() and the values returned by bar(); is there an automatic way to do it? Thanks!
1. Moving to matplotlib-0.91.2 solved the problem with PDF generation on log axes. 2. Installing matplotlib-0.91.2 on Linux required installing these packages first: * freetype-devel * libpng-devel (Those packages were NOT installed automatically by easy_install)