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
(12) |
2
(14) |
3
(13) |
4
(6) |
5
(6) |
6
(21) |
7
(29) |
8
(30) |
9
(13) |
10
(4) |
11
(4) |
12
(4) |
13
(15) |
14
(22) |
15
(23) |
16
(23) |
17
(9) |
18
(23) |
19
(12) |
20
(10) |
21
(26) |
22
(5) |
23
(32) |
24
(5) |
25
(7) |
26
(4) |
27
(3) |
28
(19) |
29
(20) |
|
|
|
From: Eric F. <ef...@ha...> - 2012-02-21 18:04:39
|
On 02/21/2012 05:10 AM, Yannick Copin wrote: > Hi, > > after iterating with Michael A. Rawlins over my previous attempt to code > a Taylor diagram (see [1]), here's a new version of my code, along with > an example plot. Maybe it could make its way into the gallery as an > example of Floating Axes and Grid Finder (even though I'm not sure the > code is particularly exemplary, comments are welcome). > > BTW, is there a plan to "organize" the Matplotlib gallery into a more > structured list of examples, e.g. with sections "Basics", "Subplots", > "Axes", "Projections", "3D", "Advanced", etc. I'm getting lost sometimes > with all those pretty graphics on a single page: although it makes its > point at proving matplotlib is a *very* good library, this might not be > very pedagogical for newbies. Such a reorganization (ideally with some pruning and editing) has been an obvious need for a long time, but I am not aware of any plan to do it. So far, no one has volunteered. Eric > > Cheers, > > [1] http://article.gmane.org/gmane.comp.python.matplotlib.general/25814 > > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Bartosz T. <b.t...@bi...> - 2012-02-21 15:56:45
|
Hi again, I found an example that implements something like I described: http://matplotlib.sourceforge.net/examples/pylab_examples/anchored_artists.html?highlight=size%20bar However, it did not allow to set arbitrary position. I modified the example to provide the anchor_to_bbox argument of AnchoredOffsetbox that allows to set the scale bars position in axes coordinates. The big gotcha is that you have to provide the loc argument to fix the that point should be adjusted to the coordinates (1 for upper right, 2 for upper left, see the docs of legend for all the codes). This is not clear in the documentation. In the example attached, I add two scalebars: vertical and horizontal that cross at the lower right corner. Bartosz |
From: Jason G. <jas...@cr...> - 2012-02-21 15:29:08
|
On 2/21/12 9:24 AM, Lou Pecora wrote: > To William Jennings. > > I would suggest you look at the SAGE python package > (http://www.sagemath.org/). Like Enthought it's an all-in-one package. > My package uses Python 2.6.4. Current versions may be higher. It has a > LOT of stuff, but you don't need to use it all and can ignore it (lots > on symbolic math, but if you don't need it just ignore it). It contains > matplotlib, numpy, scipy and lots of other scientific packages. Lots of > other stuff too, like IPython, ctypes, Cython, and a SAGE notebook > (looks good, but I haven't messed much with it). Too much to list. IIRC > it does not include wxPython, though. If you need that, you should > check. I think you can install it (see below) > > Cost? It's free. > > I've compiled several versions of it on my Macs with no hitch, but I > think you can just download Mac binary packages in a .zip file, > decompress them, and put them in the Applications folder and you're > ready to go. You can set up the sage env variable and point to the > python in the SAGE application instead of the Mac one. You can install > more in the SAGe package if you want. Just point to sage python instead > of python in the install scripts. > > I've been using it for 1 1/2 years and have been very happy with it. > It's a tour de force package of packages. Beats manual installs for my > needs any day. Noticing the title says OSX 10.7---We are working on getting Sage to compile on 10.7. I believe you can download the 10.6 binaries and they work for 10.7, though. If you have any troubles, be sure to post to the sage-support mailing list: http://groups.google.com/group/sage-support?pli=1 or ask on ask.sagemath.org. Thanks, Jason |
From: Lou P. <lou...@ya...> - 2012-02-21 15:24:57
|
To William Jennings. I would suggest you look at the SAGE python package (http://www.sagemath.org/). Like Enthought it's an all-in-one package. My package uses Python 2.6.4. Current versions may be higher. It has a LOT of stuff, but you don't need to use it all and can ignore it (lots on symbolic math, but if you don't need it just ignore it). It contains matplotlib, numpy, scipy and lots of other scientific packages. Lots of other stuff too, like IPython, ctypes, Cython, and a SAGE notebook (looks good, but I haven't messed much with it). Too much to list. IIRC it does not include wxPython, though. If you need that, you should check. I think you can install it (see below) Cost? It's free. I've compiled several versions of it on my Macs with no hitch, but I think you can just download Mac binary packages in a .zip file, decompress them, and put them in the Applications folder and you're ready to go. You can set up the sage env variable and point to the python in the SAGE application instead of the Mac one. You can install more in the SAGe package if you want. Just point to sage python instead of python in the install scripts. I've been using it for 1 1/2 years and have been very happy with it. It's a tour de force package of packages. Beats manual installs for my needs any day. -- Lou Pecora, my views are my own. |
From: Ludwig S. <lud...@gm...> - 2012-02-21 12:17:47
|
Hi all, This is a topic that I have spent way too many hours on... Ever since Mac OS 10.4 I have been fine-tuning installation instructions for these packages, aiming for the shortest instructions installing as few extras as possible. With Lion it is finally getting very simple :-) First off, I agree that the Enthought Python distribution is a good way to go. It has the downsides of being a separate Python installation (at least pretty well implemented) and costing quite a bit of money to get the full functionality. So if you want an alternative costing only a little bit of effort, read on... Second, I would not recommend installing another Python on a Mac unless you know what you are doing. Just use the system-provided Python! In my experience the Mac environment is not very well configured to handle multiple Pythons and you can easily find your Python code using some bits of the one Python distribution and some of the other, leading to strange bugs. Ask yourself whether you really need Python 2.7.2 when you already have 2.7.1 installed. [Yes, I know you can "brew install python", but it goes against the whole philosophy of Homebrew, doesn't it?] This installs the latest stable releases of these packages, using only Homebrew and easy_install. I use the system-provided NumPy 1.5.1, as this is good enough for most purposes and therefore one less package to install. I assume that you have Lion, Xcode 4 and not much else (see the more detailed instructions below if you have more than this). For the impatient, here are my instructions ready to be entered on your Terminal: /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" brew update brew install pkg-config gfortran zeromq pyqt echo "export PYTHONPATH=/usr/local/lib/python:\$PYTHONPATH" >> ~/.bash_profile sudo easy_install nose Sphinx readline Pygments pyzmq IPython matplotlib sudo CC=clang CXX=clang++ FFLAGS=-ff2c easy_install scipy I also attach a more detailed description below, including tests to check whether your installation works. Now to put all of this on a blog... :-) Enjoy and good luck, Ludwig Installing NumPy / SciPy / Matplotlib / IPython on Mac OS 10.7 (Lion) ===================================================================== Updated 21/02/2012 Apple Software -------------- - Install Mac OS 10.7 (Lion) from the App Store - Do a Software Update - Install Xcode 4 from the App Store. You need to run the "Install Xcode" app that is downloaded to /Applications. Test Xcode by confirming that "gcc" runs in the Terminal. Homebrew -------- - In preparation for homebrew, the best option is to delete /usr/local via:: sudo rm -rf /usr/local and install any software in it via homebrew instead. If this step fills you with dread and you do not want to lose your beloved third-party software, the second-best option is to make sure you have write permission for the directory via:: sudo chown -R username:staff /usr/local - Install Homebrew (http://mxcl.github.com/homebrew/) by running the following command in the Terminal:: /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" - Run "brew update" to get the latest formulas - Install the first package, just to have an existing homebrew Cellar:: brew install pkg-config - Run "brew doctor" and check the suggestions. Specifically, comment out references to Mac OS 10.6 in ~/.profile, contained in environment variables such as MACOSX_DEPLOYMENT_TARGET, CFLAGS, LDFLAGS and FFLAGS. - Now install the following packages:: brew install gfortran zeromq pyqt - Add the following lines to your ~/.bash_profile (or ~/.profile if it exists):: # This is for SIP (and PyQT) as installed (and suggested) by Homebrew export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH IPython ------- - Install the following Python packages (nose is for running unit tests, Sphinx creates documentation and readline, Pygments and pyzmq enhance IPython):: sudo easy_install nose Sphinx readline Pygments pyzmq IPython NumPy ----- - Lion comes with NumPy 1.5.1 out of the box. This is sufficient for our purposes, and we therefore use the system version. We can verify it by running the test suite from within Python:: import numpy as np np.test('full') The result for NumPy version 1.5.1 is (the failures may be ignored):: FAILED (KNOWNFAIL=4, SKIP=1, failures=8) <nose.result.TextTestResult run=3019 errors=0 failures=8> SciPy ----- - The current stable version of SciPy compiles on Lion, as long as you pass the appropriate compiler flags (you need at least 0.10.0):: sudo CC=clang CXX=clang++ FFLAGS=-ff2c easy_install scipy - Test that the installation worked by running the test suite from within Python (first change to another directory before running Python):: import scipy scipy.test() The result for SciPy version 0.10.0 is (the failures may be ignored):: FAILED (KNOWNFAIL=12, SKIP=36, failures=8) <nose.result.TextTestResult run=5095 errors=0 failures=8> Matplotlib ---------- - If you want support for TeX rendering in matplotlib, install MacTeX first from http://www.tug.org/mactex. - Matplotlib is now easy_installable on Lion (you need at least version 1.1.0):: sudo easy_install matplotlib - Test that the installation worked by running the test suite from within Python (first change to another directory before running Python):: import pylab pylab.test() The result for Matplotlib version 1.1.0 is:: OK (SKIP=1) <nose.result.TextTestResult run=156 errors=0 failures=0> - A more thorough test of Matplotlib involves the following:: brew install libjpeg wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz tar xzvf Imaging-1.1.7.tar.gz cd Imaging-1.1.7 <... edit setup.py so that 'FREETYPE_ROOT = libinclude("/usr/X11R6")' ...> python setup.py build sudo python setup.py install <... start python ...> import matplotlib matplotlib.test() The result for Matplotlib version 1.1.0 is (this takes a while!):: Ran 993 tests in 208.338s OK (KNOWNFAIL=264) This generates a lot of test images in the current directory - feel free to wipe the result_images/ directory afterwards. - Install the matplotlibrc file in your home directory and edit it to select the default backend. If you followed these instructions you should be able to use the MacOSX, TkAgg and Qt4Agg interactive backends:: mkdir ~/.matplotlib cp /Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/matplotlib/mpl-data/matplotlibrc ~/.matplotlib vi ~/.matplotlib/matplotlibrc - For fun, try out the new IPython Qt console and HTML notebook with inline Matplotlib plots (assuming you have at least IPython version 0.12). This is a good test to verify that all the previous steps worked. In the Qt console, type `plot([1,2])` to see an inline plot appear (this also highlights the function help docstring that pops up as you type). In the notebook, click on "New Notebook" on the initial HTML page that pops up in your browser, and type `plot([1,2])` in the first cell of the notebook page, followed by Shift-Enter to see the inline plot:: ipython qtconsole --pylab=inline ipython notebook --pylab=inline |
From: Bartosz T. <b.t...@bi...> - 2012-02-21 10:53:22
|
Hi all, I am trying to add to the axes a sizebar (a line of length specified in data coordinates) at a fixed location relative to the axes (in axes coordinates). The idea is that I have several subplots with different scales and I want to add scalebar at the same position to each of them. I tried using ScaledTranslation transformation, but with no success (after export to SVG the scalebars are gone). I thought that I might use OffsetBox (the same that the legend is based on), but I have no idea how to use it. Do you have any suggestions? Thanks, Bartosz |
From: Bartosz T. <b.t...@bi...> - 2012-02-21 10:50:39
|
Hi, It is a very nice example. svgutils is a svg editting library and so it does not do any transformations itself. All the coordinates must be defined in the SVG space, whose origin is in the top left. Cheers, Bartosz On 21.02.2012, at 09:33, William Hoburg wrote: > Hi > > @Jakob and Bartosz > > Thx; Both approches (PYX and svgutils) worked well. > But there are some things to consider. svgutils for instance uses coordinates from the top left corner. > On Ubuntu (I use 11.10 x64) PYX can be installed from repository using synaptics. svgutils can be installed without problems from the github repository. > > I included (as text to avoid download problems for others) a example script where I utilize mpl to generate svg and eps files and combine the eps using PYX and the svg using svgutils. > > @ Jerzy Karczmarczuk: >> 1. You have gradients, clipping paths, patterns, and filtering, which >> interpolates between vector and raster data. You will not implement >> easily as an "artist" the blur, displacement maps, or morphologic filters > > What I intended to do can be seen in the attached svg figure. I do not need gradient, filtering, effects and so on. I only need basic functionality like lines or circles do add simple graphics into my mpl plot. The subfigure inside the mpl plot was drawn in Inkscape now inserted svgutils. The resulting svg (or eps) will be used in my lyx document which is converted to a pdf on the fly by Inkscape. > > > @ all: Did anyone try http://cairographics.org/pyrsvg/ to achieve the above questioned. > > Cheers, > HoWil > > > #============================================================================== > #============================================================================== > # Demo script to combine two vector graphics like eps and svg in python. > # The combined files in this demo were generated using matplotlib > > from matplotlib import * > from matplotlib.pyplot import * > > #============================================================================== > # Build a figure and export it as eps and svg in two different versions > #============================================================================== > > # Figure adjustment > f_Xsize_cm = 10.; > f_Ysize_cm = 8.; > > fig = figure(figsize=(f_Xsize_cm/2.5, f_Ysize_cm/2.5)); > > fig.patch.set_alpha(0.2) > > # > ax = fig.add_subplot(111) > ax.patch.set_alpha(0.7) > > text(0.22,0.25,'eps-SVG \n vector \n graphics',fontsize=30, color=[0.6,0.6,0.6]) > # Fill the axis with some color > ax.set_axis_bgcolor([0.9,0.9,0.1]) > > # Remove all ticks and ticklabels to get rectangles > ax.set_yticklabels(()) > ax.set_xticklabels(()) > ax.set_xticks([]) > ax.set_yticks([]) > > # Export first version of eps and svg figure > fig.savefig('exportSub.eps'); > fig.savefig('exportSub.svg'); > > # Export second version of eps and svg figure > ax.set_axis_bgcolor([0.1,0.9,0.1]) > text(0.1,0.4,'2nd',fontsize=40, color=[0.9,0.2,0.2], rotation=45) > fig.savefig('exportSub2nd.eps'); > fig.savefig('exportSub2nd.svg'); > > > > #============================================================================== > # Utilizing 'Pyx' from http://pyx.sourceforge.net/ > #============================================================================== > from pyx import * > > c = canvas.canvas() > # load both external files > c.insert(epsfile.epsfile(0, 0, "exportSub.eps")) > c.insert(epsfile.epsfile(f_Xsize_cm/2, f_Ysize_cm/3, "exportSub2nd.eps")) > > # save generated EPS files > c.writeEPSfile("export") > > > #============================================================================== > # Utilizing 'svgutils' from https://github.com/btel/svg_utils > #============================================================================== > import svgutils.transform as sg > #import sys > > #create new SVG figure > fig = sg.SVGFigure() > > # load both external files > fig1 = sg.fromfile('exportSub.svg') > fig2 = sg.fromfile('exportSub2nd.svg') > > # get the plot objects > plot1 = fig1.getroot() > # mpl-figures have to be scaled > plot1.moveto(0, 0, scale=1.25) > > plot2 = fig2.getroot() > # x-,y- coordinates are measured from the top left corner > factor = 35.433 # scale factor cm/px, out of inkscape > plot2.moveto(f_Xsize_cm/2 * factor, -f_Ysize_cm/3 * factor, scale=1.25) > > # append plots and labels to figure > fig.append([plot1]) > fig.append([plot2]) > > # save generated SVG files > fig.save("export.svg") > > > > > -- > Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir > belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de Bartosz Telenczuk Institute for Theoretical Biology Humboldt University of Berlin, Germany Phone: +4930/2093-8838 Homepage: http://neuroscience.telenczuk.pl |
From: Scott S. <sco...@gm...> - 2012-02-21 10:04:34
|
On 20 February 2012 07:08, surfcast23 <sur...@gm...> wrote: > > Hi I wrote the following script, but it hangs right after plt.show(). I would > really appreciate it if someone could take a look and let me know where I'm > messing up. Thanks in advance Your script works fine for me. It's just that on the first pass through the loop you're calling plt.plot() and asking it to plot a line defined by a single point, so the plot is blank. If you close the plot you'll see that the next one has a line. Close that and you'll see a line composed of two segments etc... Alternatively, reduce the indentation level of your plot command and plot the entire trace after the loop completes. Cheers, Scott |
From: William H. <Ho...@gm...> - 2012-02-21 08:33:29
|
Hi @Jakob and Bartosz Thx; Both approches (PYX and svgutils) worked well. But there are some things to consider. svgutils for instance uses coordinates from the top left corner. On Ubuntu (I use 11.10 x64) PYX can be installed from repository using synaptics. svgutils can be installed without problems from the github repository. I included (as text to avoid download problems for others) a example script where I utilize mpl to generate svg and eps files and combine the eps using PYX and the svg using svgutils. @ Jerzy Karczmarczuk: >1. You have gradients, clipping paths, patterns, and filtering, which >interpolates between vector and raster data. You will not implement >easily as an "artist" the blur, displacement maps, or morphologic filters What I intended to do can be seen in the attached svg figure. I do not need gradient, filtering, effects and so on. I only need basic functionality like lines or circles do add simple graphics into my mpl plot. The subfigure inside the mpl plot was drawn in Inkscape now inserted svgutils. The resulting svg (or eps) will be used in my lyx document which is converted to a pdf on the fly by Inkscape. @ all: Did anyone try http://cairographics.org/pyrsvg/ to achieve the above questioned. Cheers, HoWil #============================================================================== #============================================================================== # Demo script to combine two vector graphics like eps and svg in python. # The combined files in this demo were generated using matplotlib from matplotlib import * from matplotlib.pyplot import * #============================================================================== # Build a figure and export it as eps and svg in two different versions #============================================================================== # Figure adjustment f_Xsize_cm = 10.; f_Ysize_cm = 8.; fig = figure(figsize=(f_Xsize_cm/2.5, f_Ysize_cm/2.5)); fig.patch.set_alpha(0.2) # ax = fig.add_subplot(111) ax.patch.set_alpha(0.7) text(0.22,0.25,'eps-SVG \n vector \n graphics',fontsize=30, color=[0.6,0.6,0.6]) # Fill the axis with some color ax.set_axis_bgcolor([0.9,0.9,0.1]) # Remove all ticks and ticklabels to get rectangles ax.set_yticklabels(()) ax.set_xticklabels(()) ax.set_xticks([]) ax.set_yticks([]) # Export first version of eps and svg figure fig.savefig('exportSub.eps'); fig.savefig('exportSub.svg'); # Export second version of eps and svg figure ax.set_axis_bgcolor([0.1,0.9,0.1]) text(0.1,0.4,'2nd',fontsize=40, color=[0.9,0.2,0.2], rotation=45) fig.savefig('exportSub2nd.eps'); fig.savefig('exportSub2nd.svg'); #============================================================================== # Utilizing 'Pyx' from http://pyx.sourceforge.net/ #============================================================================== from pyx import * c = canvas.canvas() # load both external files c.insert(epsfile.epsfile(0, 0, "exportSub.eps")) c.insert(epsfile.epsfile(f_Xsize_cm/2, f_Ysize_cm/3, "exportSub2nd.eps")) # save generated EPS files c.writeEPSfile("export") #============================================================================== # Utilizing 'svgutils' from https://github.com/btel/svg_utils #============================================================================== import svgutils.transform as sg #import sys #create new SVG figure fig = sg.SVGFigure() # load both external files fig1 = sg.fromfile('exportSub.svg') fig2 = sg.fromfile('exportSub2nd.svg') # get the plot objects plot1 = fig1.getroot() # mpl-figures have to be scaled plot1.moveto(0, 0, scale=1.25) plot2 = fig2.getroot() # x-,y- coordinates are measured from the top left corner factor = 35.433 # scale factor cm/px, out of inkscape plot2.moveto(f_Xsize_cm/2 * factor, -f_Ysize_cm/3 * factor, scale=1.25) # append plots and labels to figure fig.append([plot1]) fig.append([plot2]) # save generated SVG files fig.save("export.svg") -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de |
From: Nicolas Le B. <Nic...@gi...> - 2012-02-21 07:54:35
|
Hi William, I have also spent some time to have a numpy/scipy/matplotlib set working under mac os X lion (10.7.3).... I use python 2.7.2, and work with ipython (0.12) in pylab mode. I finally did a mixture of several posts on forums and got it to work properly now. Here is the recipe : 1 - Install homebrew (and remove macport and fink) and easy-install / pip 2 - Install python, gfortran and pkg-config using homebrew With homebrew, everything should be installed in /usr/local/Cellar 3 - Install ipython (0.12) and numpy (1.6.1) with homebrew 4 - Scipy install (version 0.11.0.dev-e857412 ) : pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev It automatically installs scipy in /Users/nicolas/src and link it to /usr/local/Cellar/ 5 - Matplotlib install (dev as well 1.2.x): sudo make -f make.osx PREFIX=/Users/nicolas/src PYVERSION=2.7 fetch deps mpl_install_std It also instal in /Users/yourname/src/ It also 6 - add to your .bash_profile the following : export PATH=/usr/local/bin:$PATH export PATH=/usr/local/share/python:$PATH export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH The "not very nice and clean" art is that I have a /src folder (which contains numpy) and a /matplotilib folder in my /Users/nicolas.... I hope it helps. Nicolas On 20 févr. 2012, at 21:17, William Jennings wrote: > Hello mat plot lib users! > > I feel quite embarrassed that I’ve gone through 2 days of trying to get to get numpy, scipy and matplotlib all to work nice with each other. I’ve scraped through forums, stackoverflow and all the links that can bide me some type of logic. Yet, alas I still fail wildly with this set of errors: > > my current status is: just did a fresh install of my lion os and haven't installed Xcode yet. I'm a little lost and have found only macports, homebrew guides online only to be a slower failure. I really need to use this software but I'm finding it difficult keeping straight what order and what I need to install. Is it best to have python 2.6 or 2.72? if it's 2.72 should it be the universal version from python.org? Once that is installed is it best to just install numpy and scipy from github and then try matplotlib? I know I need to install fortran and make sure that it's using G++ 4.2 and C++ 4.2 BEFORE i run scipy and numpy setup... Yet, right now I'm floundering for a clear example on 10 or so commands I should put into terminal and in the correct order for how to install it. I promise once I learn how to install I'll put a resource on the web or link back to some of the better resources. As for now my freshly installed os computer is in your hands currently with python 2.71 that was preinstalled with Lion. That is all I've done thus far. > > Thank you ! > > Here is the old error I was getting when I used the home brew guide that I found here: bit.ly/qGdKy9 > In file included from src/backend_agg.cpp:11: > In file included from src/_backend_agg.h:34: > agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference to type ‘agg::line_profile_aa’ to a value of type ‘const agg::line_profile_aa’ drops qualifiers > line_profile_aa& profile() { return *m_profile; } > ^~~~~~~~~~ > 1 error generated. > error: command ‘/usr/bin/clang’ failed with exit status 1 > —————————————- > Command /Users/Will/.virtualenvs/test1/bin/python -c “import setuptools;file=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’; exec(compile(open(file).read().replace(‘\r\n’, ‘\n’), file, ‘exec’))” develop –no-deps failed with error code 1 in /Users/Will/.virtualenvs/test1/src/matplotlib > Storing complete log in /Users/Will/.pip/pip.log > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Eric F. <ef...@ha...> - 2012-02-21 07:05:22
|
On 02/20/2012 07:07 PM, William Jennings wrote: > Hello mat plot lib users! > > I feel quite embarrassed that I’ve gone through 2 days of trying to get > to get numpy, scipy and matplotlib all to work nice with each other. > I’ve scraped through forums, stackoverflow and all the links that can > bide me some type of logic. Yet, alas I still fail wildly with this set > of errors: > > *my current status is: just did a fresh install of my lion os and > haven't installed Xcode yet. I'm a little lost and have found only > macports, homebrew guides online only to be a slower failure. I really > need to use this software but I'm finding it difficult keeping straight > what order and what I need to install. Is it best to have python 2.6 or > 2.72? if it's 2.72 should it be the universal version from python.org > <http://python.org/>? Once that is installed is it best to just install > numpy and scipy from github and then try matplotlib? I know I need to > install fortran and make sure that it's using G++ 4.2 and C++ 4.2 BEFORE > i run scipy and numpy setup... Yet, right now I'm floundering for a > clear example on 10 or so commands I should put into terminal and in the > correct order for how to install it. I promise once I learn how to > install I'll put a resource on the web or link back to some of the > better resources. As for now my freshly installed os computer is in your > hands currently with python 2.71 that was preinstalled with Lion. That > is all I've done thus far. * The Enthought suggestion is a good one. Another possibility is to install the python 2.7 from the http://python.org/download Mac installer (the one for Mac OS X 10.6 and 10.7), then the corresponding numpy installer (see scipy.org; the download would be from http://sourceforge.net/projects/numpy/files/NumPy/1.6.1/ and you want the one near the bottom, ending in "macosx10.6.dmg"), and last the recently added mpl Mac installer for python 2.7, the first file you see here: http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/ I haven't tried it--I don't have a mac--but I'm pretty sure the above set should all work together. Eric > * > * > *Thank you !* > * > * > *Here is the old error I was getting when I used the home brew guide > that I found here: *bit.ly/qGdKy9 <http://bit.ly/qGdKy9> > > In file included from src/backend_agg.cpp:11: > In file included from src/_backend_agg.h:34: > agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of > reference to type ‘agg::line_profile_aa’ to a value of type ‘const > agg::line_profile_aa’ drops qualifiers > line_profile_aa& profile() { return *m_profile; } > ^~~~~~~~~~ > 1 error generated. > error: command ‘/usr/bin/clang’ failed with exit status 1 > —————————————- > Command /Users/Will/.virtualenvs/test1/bin/python -c “import > setuptools;*file*=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’; > exec(compile(open(*file*).read().replace(‘\r\n’, ‘\n’), *file*, > ‘exec’))” develop –no-deps failed with error code 1 in > /Users/Will/.virtualenvs/test1/src/matplotlib > Storing complete log in /Users/Will/.pip/pip.log > > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Andre' Walker-L. <wal...@gm...> - 2012-02-21 05:28:31
|
Hi William, There is a company, Enthought, which offers a free package installer, which comes with 6 "essential" python libraries, including matplotlib. http://www.enthought.com/products/epd_free.php If you have an "edu" email account (you are an academic, or do academic research at a gov lab, like LBL) you can download their full set of libraries http://www.enthought.com/products/edudownload.php If not, and you think it is worth it (or can get your company to pay), starting at $199 you can download their package installer (and get their tech support). Couple words about them: I have no affiliation with them. Some of their original employees were deeply involved in numpy. They developed a 3D plotting library, Mayavi, which is pretty cool. I am reasonably comfortable with my mac, installing src code etc. I used to install everything myself (back on OS X Tiger). Then, when I upgraded to Snow Leopard, I couldn't get it all to work out - I did an account migration from old to new, and then there were some issues (I think) relating to the 32 vs 64 bit compatibility that I couldn't resolve. I went to a friend who is good with computers to get help - he said "You should just use the Enthought installer - its so easy, that is what I do". That helped me get over feeling like I had to do it all myself. (Of course some day, when I have heaps of free time and no pressure from work, I will sort out how to do it all myself again....) I am guessing if you want to link numpy against the full BLAS/LAPACK libraries for optimal speed on matrix manipulation etc, then you may need to do the installation yourself, including all the fortran libraries. But at least with their package installer, it should work out of the box. Also, it installs the whole suite as a "Framework" in /Library/Frameworks/Python.framework/Versions/ with a cleverly chosen Version so as not to mesh with your own installation. So you can install there version, based on 2.7 and your own version 2.7 and they won't interfere. You'll just have to relink the /usr/bin/python and /usr/local/bin/python to which version you want. Good luck, Andre On Feb 20, 2012, at 9:07 PM, William Jennings wrote: > Hello mat plot lib users! > > I feel quite embarrassed that I’ve gone through 2 days of trying to get to get numpy, scipy and matplotlib all to work nice with each other. I’ve scraped through forums, stackoverflow and all the links that can bide me some type of logic. Yet, alas I still fail wildly with this set of errors: > > my current status is: just did a fresh install of my lion os and haven't installed Xcode yet. I'm a little lost and have found only macports, homebrew guides online only to be a slower failure. I really need to use this software but I'm finding it difficult keeping straight what order and what I need to install. Is it best to have python 2.6 or 2.72? if it's 2.72 should it be the universal version from python.org? Once that is installed is it best to just install numpy and scipy from github and then try matplotlib? I know I need to install fortran and make sure that it's using G++ 4.2 and C++ 4.2 BEFORE i run scipy and numpy setup... Yet, right now I'm floundering for a clear example on 10 or so commands I should put into terminal and in the correct order for how to install it. I promise once I learn how to install I'll put a resource on the web or link back to some of the better resources. As for now my freshly installed os computer is in your hands currently with python 2.71 that was preinstalled with Lion. That is all I've done thus far. > > Thank you ! > > Here is the old error I was getting when I used the home brew guide that I found here: bit.ly/qGdKy9 > In file included from src/backend_agg.cpp:11: > In file included from src/_backend_agg.h:34: > agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference to type ‘agg::line_profile_aa’ to a value of type ‘const agg::line_profile_aa’ drops qualifiers > line_profile_aa& profile() { return *m_profile; } > ^~~~~~~~~~ > 1 error generated. > error: command ‘/usr/bin/clang’ failed with exit status 1 > —————————————- > Command /Users/Will/.virtualenvs/test1/bin/python -c “import setuptools;file=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’; exec(compile(open(file).read().replace(‘\r\n’, ‘\n’), file, ‘exec’))” develop –no-deps failed with error code 1 in /Users/Will/.virtualenvs/test1/src/matplotlib > Storing complete log in /Users/Will/.pip/pip.log > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: William J. <wil...@gm...> - 2012-02-21 05:07:44
|
Hello mat plot lib users! I feel quite embarrassed that I’ve gone through 2 days of trying to get to get numpy, scipy and matplotlib all to work nice with each other. I’ve scraped through forums, stackoverflow and all the links that can bide me some type of logic. Yet, alas I still fail wildly with this set of errors: *my current status is: just did a fresh install of my lion os and haven't installed Xcode yet. I'm a little lost and have found only macports, homebrew guides online only to be a slower failure. I really need to use this software but I'm finding it difficult keeping straight what order and what I need to install. Is it best to have python 2.6 or 2.72? if it's 2.72 should it be the universal version from python.org? Once that is installed is it best to just install numpy and scipy from github and then try matplotlib? I know I need to install fortran and make sure that it's using G++ 4.2 and C++ 4.2 BEFORE i run scipy and numpy setup... Yet, right now I'm floundering for a clear example on 10 or so commands I should put into terminal and in the correct order for how to install it. I promise once I learn how to install I'll put a resource on the web or link back to some of the better resources. As for now my freshly installed os computer is in your hands currently with python 2.71 that was preinstalled with Lion. That is all I've done thus far. * * * *Thank you !* * * *Here is the old error I was getting when I used the home brew guide that I found here: *bit.ly/qGdKy9 In file included from src/backend_agg.cpp:11: In file included from src/_backend_agg.h:34: agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference to type ‘agg::line_profile_aa’ to a value of type ‘const agg::line_profile_aa’ drops qualifiers line_profile_aa& profile() { return *m_profile; } ^~~~~~~~~~ 1 error generated. error: command ‘/usr/bin/clang’ failed with exit status 1 —————————————- Command /Users/Will/.virtualenvs/test1/bin/python -c “import setuptools;* file*=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’; exec(compile(open(*file*).read().replace(‘\r\n’, ‘\n’), *file*, ‘exec’))” develop –no-deps failed with error code 1 in /Users/Will/.virtualenvs/test1/src/matplotlib Storing complete log in /Users/Will/.pip/pip.log |
From: Benjamin R. <ben...@ou...> - 2012-02-21 03:29:55
|
On Sunday, February 19, 2012, Limping_Twerp wrote: > > Hey guys, > > how do I configure my plot in a way that there arent framed axes but cross > - > section -axes? I talk about this > > > > | > | > | > | > | > ____________|______________ > | > | > | > | > | > > Any help? Don't have the link on me right now, but search on the mpl website for "spines", and you should find what you are looking for. If not, look through the gallery, I know there is an example there. Ben Root |
From: Jeff B. <jbl...@al...> - 2012-02-21 03:02:15
|
On Feb 20, 2012, at 4:10 AM, 李颜涛 wrote: > <bitmap2.png> > > > I try to set the axis tick width in matplotlibrc file,but I could't find the item. > I want to know whether the tick width can be changed. I adjust this using mpl.rcParams['lines.markeredgewidth'] = 1.5 # or whatever value you want This will also adjust things other than just the tick marks, but hopefully it does what you want. -Jeff |
From: Gökhan S. <gok...@gm...> - 2012-02-21 02:27:55
|
Hello, Stealing a solution from -> http://old.nabble.com/scientific-notation-in-ticklabels-for-linear-plot-td29993489.html This seems to produce nicer looking y tick-labels. I tend to switch to log-scale in cases like yours, but this one provides a clean solution as well. import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter def scinot(x,pos=None): if x == 0: s = '0' else: xp = int(np.floor(np.log10(np.abs(x)))) mn = x/10.**xp # Here we truncate to 2 significant digits -- may not be enough # in all cases s = '$'+str('%.3f'%mn) +'\\times 10^{'+str(xp)+'}$' return s A = np.array([[ 1.00000000e+00, 0.00000000e+00, 1.99236400e-04], [ 2.00000000e+00, 1.00000000e+00, 2.00043800e-04], [ 3.00000000e+00, 2.00000000e+00, 2.00046000e-04], [ 4.00000000e+00, 3.00000000e+00, 2.00043900e-04]]) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(A[:,1],A[:,2]) ax.yaxis.set_major_formatter(FuncFormatter(scinot)) y_min,y_max = ax.get_ylim() print 'y range', y_max-y_min plt.show() On Mon, Feb 20, 2012 at 8:32 AM, Nils Wagner <nw...@ia...>wrote: > Hi all, > > How can I improve the presentation of yticks for a small y range, e.g. > > y_min,y_max = ax.get_ylim() >>> >>>> y_max-y_min >>>> >>> 8.9999999999996767e-07 > > I would like to avoid "+1.992 x 10^{-4}" in the attached figure. > > import numpy as np > import matplotlib.pyplot as plt > from matplotlib.ticker import ScalarFormatter > formatter = ScalarFormatter(useMathText=**True) > formatter.set_scientific(True) > formatter.set_powerlimits((-**15,15)) > #A = np.loadtxt('trash.dat') > A = np.array([[ 1.00000000e+00, 0.00000000e+00, 1.99236400e-04], > [ 2.00000000e+00, 1.00000000e+00, 2.00043800e-04], > [ 3.00000000e+00, 2.00000000e+00, 2.00046000e-04], > [ 4.00000000e+00, 3.00000000e+00, 2.00043900e-04]]) > > > fig = plt.figure() > ax = fig.add_subplot(111) > ax.yaxis.set_major_formatter(**formatter) > ax.plot(A[:,1],A[:,2]) > y_min,y_max = ax.get_ylim() > print 'y range', y_max-y_min > plt.show() > > > Nils > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Gökhan |
From: Edward C. J. <edc...@co...> - 2012-02-21 02:05:34
|
I use Debian stable. The python-matplotlib package version is 0.99.3-1. Here is a small program which threw many exceptions whenever I moved the mouse across the matplotlib display. #! /usr/bin/env python import matplotlib import matplotlib.pyplot as plt counts = [1, 8, 71] diffs = range(len(counts)) plt.plot(diffs, counts) plt.axes([0, 200, 0, 100]) plt.show() Here is one of the tracebacks: Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ return self.func(*args) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 246, in motion_notify_event FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 1244, in motion_notify_event guiEvent=guiEvent) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 899, in __init__ LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 813, in __init__ axes_list = [a for a in self.canvas.figure.get_axes() if a.in_axes(self)] File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1538, in in_axes return self.patch.contains(mouseevent)[0] File "/usr/lib/pymodules/python2.6/matplotlib/patches.py", line 502, in contains x, y = self.get_transform().inverted().transform_point( File "/usr/lib/pymodules/python2.6/matplotlib/transforms.py", line 1430, in inverted self._inverted = Affine2D(inv(mtx)) File "/usr/lib/pymodules/python2.6/numpy/linalg/linalg.py", line 423, in inv return wrap(solve(a, identity(a.shape[0], dtype=a.dtype))) File "/usr/lib/pymodules/python2.6/numpy/linalg/linalg.py", line 306, in solve raise LinAlgError, 'Singular matrix' LinAlgError: Singular matrix A Google search on "matplotlib mouseevent singular matrix" found that a similar problem was discussed in matplotlib-users on Jul 29, 2008: "bar plot picker with 0 height data". John Hunter committed a fix: "svn r5922". The program that caused the bug in 2008 works on my system. The problem is: The docs for matplotlib.pyplot.axes say [left, bottom, width, height] but the docs for matplotlib.pyplot.axis say [xmin, xmax, ymin, ymax]. I should have used "axis" where I used "axes" which is an easy error to make. I suggest that "axes" should raise an exception if width or height is zero. |
From: Jeffrey M. <jm...@gm...> - 2012-02-21 00:48:43
|
It works perfectly. I thought I had tried that. :/ On Mon, Feb 20, 2012 at 4:18 PM, Eric Firing <ef...@ha...> wrote: > On 02/20/2012 01:36 PM, Jeffrey Melloy wrote: >> I'm using Flask to output graphs to a web service, and when I move >> from a standalone script to the web service I'm getting weird >> behavior. >> >> In gantt_test.py, I do this: >> >> from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas >> from matplotlib.figure import Figure >> [...] >> >> canvas = FigureCanvas(fig) >> fig.savefig("gantt.png") >> >> >> And it looks nice. >> >> In the web service, the only difference is: >> >> canvas = FigureCanvas(fig) >> >> x = StringIO() >> >> canvas.print_png(x, facecolor="w", edgecolor="w", dpi=100) > > What happens if instead of using canvas.print_png you use > fig.savefig(x, format="png") > > Eric > >> >> And it has a grey background, weirder margins, and seems to be stuck at dpi=80. >> >> What am I missing? The version of python& matplotlib are the same >> between machines. One is Windows 7, the other 2K3. >> >> -Jeff >> >> >> >> ------------------------------------------------------------------------------ >> Try before you buy = See our experts in action! >> The most comprehensive online learning library for Microsoft developers >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >> Metro Style Apps, more. Free future releases when you subscribe now! >> http://p.sf.net/sfu/learndevnow-dev2 >> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Edward C. J. <edc...@co...> - 2012-02-21 00:46:09
|
I use Debian stable. The python-matplotlib package version is 0.99.3-1. Here is a small program which threw many exceptions whenever I moved the mouse across the matplotlib display. #! /usr/bin/env python import matplotlib import matplotlib.pyplot as plt counts = [1, 8, 71] diffs = range(len(counts)) plt.plot(diffs, counts) plt.axes([0, 200, 0, 100]) plt.show() Here is one of the tracebacks: Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ return self.func(*args) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 246, in motion_notify_event FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 1244, in motion_notify_event guiEvent=guiEvent) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 899, in __init__ LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 813, in __init__ axes_list = [a for a in self.canvas.figure.get_axes() if a.in_axes(self)] File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1538, in in_axes return self.patch.contains(mouseevent)[0] File "/usr/lib/pymodules/python2.6/matplotlib/patches.py", line 502, in contains x, y = self.get_transform().inverted().transform_point( File "/usr/lib/pymodules/python2.6/matplotlib/transforms.py", line 1430, in inverted self._inverted = Affine2D(inv(mtx)) File "/usr/lib/pymodules/python2.6/numpy/linalg/linalg.py", line 423, in inv return wrap(solve(a, identity(a.shape[0], dtype=a.dtype))) File "/usr/lib/pymodules/python2.6/numpy/linalg/linalg.py", line 306, in solve raise LinAlgError, 'Singular matrix' LinAlgError: Singular matrix A Google search on "matplotlib mouseevent singular matrix" found that a similar problem was discussed in matplotlib-users on Jul 29, 2008: "bar plot picker with 0 height data". John Hunter committed a fix: "svn r5922". The program that caused the bug in 2008 works on my system. |
From: Eric F. <ef...@ha...> - 2012-02-21 00:18:44
|
On 02/20/2012 01:36 PM, Jeffrey Melloy wrote: > I'm using Flask to output graphs to a web service, and when I move > from a standalone script to the web service I'm getting weird > behavior. > > In gantt_test.py, I do this: > > from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas > from matplotlib.figure import Figure > [...] > > canvas = FigureCanvas(fig) > fig.savefig("gantt.png") > > > And it looks nice. > > In the web service, the only difference is: > > canvas = FigureCanvas(fig) > > x = StringIO() > > canvas.print_png(x, facecolor="w", edgecolor="w", dpi=100) What happens if instead of using canvas.print_png you use fig.savefig(x, format="png") Eric > > And it has a grey background, weirder margins, and seems to be stuck at dpi=80. > > What am I missing? The version of python& matplotlib are the same > between machines. One is Windows 7, the other 2K3. > > -Jeff > > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jeffrey M. <jm...@gm...> - 2012-02-20 23:36:46
|
I'm using Flask to output graphs to a web service, and when I move from a standalone script to the web service I'm getting weird behavior. In gantt_test.py, I do this: from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure [...] canvas = FigureCanvas(fig) fig.savefig("gantt.png") And it looks nice. In the web service, the only difference is: canvas = FigureCanvas(fig) x = StringIO() canvas.print_png(x, facecolor="w", edgecolor="w", dpi=100) And it has a grey background, weirder margins, and seems to be stuck at dpi=80. What am I missing? The version of python & matplotlib are the same between machines. One is Windows 7, the other 2K3. -Jeff |
From: Allen H. <AHa...@au...> - 2012-02-20 20:49:03
|
Worked like a charm. Thanks. Allen From: ben...@gm... [mailto:ben...@gm...] On Behalf Of Benjamin Root Sent: Monday, February 20, 2012 3:21 PM To: Allen Hathaway Cc: mat...@li... Subject: Re: [Matplotlib-users] Animation module On Mon, Feb 20, 2012 at 12:32 PM, Allen Hathaway <AHa...@au...> wrote: I downloaded the Windows installer and installed matplotlib. I tried to run one of the examples from the examples directory - animate_decay - and got the following error: Traceback (most recent call last): File "C:\Bin\Python Scripts\plot_decay.py", line 3, in <module> import matplotlib.animation as animation ImportError: No module named animation What did I do wrong? Allen Chances are, an older version of matplotlib is still installed. Clean out all matplotlib installs and reinstall the current one. (Note: need v1.1.0 and greater for the animation module). Also, please keep in mind the animation module is very much an experiment and we greatly welcome feedback on how it works for you! Cheers! Ben Root |
From: Benjamin R. <ben...@ou...> - 2012-02-20 20:21:20
|
On Mon, Feb 20, 2012 at 12:32 PM, Allen Hathaway <AHa...@au...>wrote: > I downloaded the Windows installer and installed matplotlib. I tried to > run one of the examples from the examples directory – animate_decay – and > got the following error:**** > > ** ** > > Traceback (most recent call last):**** > > File "C:\Bin\Python Scripts\plot_decay.py", line 3, in <module>**** > > import matplotlib.animation as animation**** > > ImportError: No module named animation**** > > ** ** > > What did I do wrong?**** > > ** ** > > Allen**** > > Chances are, an older version of matplotlib is still installed. Clean out all matplotlib installs and reinstall the current one. (Note: need v1.1.0 and greater for the animation module). Also, please keep in mind the animation module is very much an experiment and we greatly welcome feedback on how it works for you! Cheers! Ben Root |
From: William J. <wil...@gm...> - 2012-02-20 20:18:07
|
Hello mat plot lib users! I feel quite embarrassed that I’ve gone through 2 days of trying to get to get numpy, scipy and matplotlib all to work nice with each other. I’ve scraped through forums, stackoverflow and all the links that can bide me some type of logic. Yet, alas I still fail wildly with this set of errors: *my current status is: just did a fresh install of my lion os and haven't installed Xcode yet. I'm a little lost and have found only macports, homebrew guides online only to be a slower failure. I really need to use this software but I'm finding it difficult keeping straight what order and what I need to install. Is it best to have python 2.6 or 2.72? if it's 2.72 should it be the universal version from python.org? Once that is installed is it best to just install numpy and scipy from github and then try matplotlib? I know I need to install fortran and make sure that it's using G++ 4.2 and C++ 4.2 BEFORE i run scipy and numpy setup... Yet, right now I'm floundering for a clear example on 10 or so commands I should put into terminal and in the correct order for how to install it. I promise once I learn how to install I'll put a resource on the web or link back to some of the better resources. As for now my freshly installed os computer is in your hands currently with python 2.71 that was preinstalled with Lion. That is all I've done thus far. * * * *Thank you !* * * *Here is the old error I was getting when I used the home brew guide that I found here: *bit.ly/qGdKy9 In file included from src/backend_agg.cpp:11: In file included from src/_backend_agg.h:34: agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference to type ‘agg::line_profile_aa’ to a value of type ‘const agg::line_profile_aa’ drops qualifiers line_profile_aa& profile() { return *m_profile; } ^~~~~~~~~~ 1 error generated. error: command ‘/usr/bin/clang’ failed with exit status 1 —————————————- Command /Users/Will/.virtualenvs/test1/bin/python -c “import setuptools;* file*=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’; exec(compile(open(*file*).read().replace(‘\r\n’, ‘\n’), *file*, ‘exec’))” develop –no-deps failed with error code 1 in /Users/Will/.virtualenvs/test1/src/matplotlib Storing complete log in /Users/Will/.pip/pip.log |
From: Allen H. <AHa...@au...> - 2012-02-20 19:54:24
|
I downloaded the Windows installer and installed matplotlib. I tried to run one of the examples from the examples directory - animate_decay - and got the following error: Traceback (most recent call last): File "C:\Bin\Python Scripts\plot_decay.py", line 3, in <module> import matplotlib.animation as animation ImportError: No module named animation What did I do wrong? Allen |