SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
2
(2)
3
(16)
4
(22)
5
(7)
6
7
(9)
8
(2)
9
10
(7)
11
(15)
12
(7)
13
(4)
14
(7)
15
(3)
16
(6)
17
(20)
18
(18)
19
(15)
20
(27)
21
(14)
22
23
(1)
24
(18)
25
(22)
26
(36)
27
(17)
28
(6)
29
(2)
30
(3)
31
(6)





Showing results of 303

<< < 1 .. 6 7 8 9 10 .. 13 > >> (Page 8 of 13)
From: Tomáš F. <sen...@em...> - 2010年05月18日 16:31:15
I am using "pmap -pid" on Linux and Task manager on Windows. Memory usage is comparable on both operating systems so I think the memory consumption information is accurate.
> ------------ Pôvodná správa ------------
> Od: Michael Droettboom <md...@st...>
> Predmet: Re: [Matplotlib-users] imshow memory problem
> Dátum: 18.5.2010 16:18:23
> ----------------------------------------
> What are you using to calculate memory usage? I feel the only truly 
> reliable tool is something instrumented like "valgrind --tool=massif".
> 
> ============================================================================
> BUILDING MATPLOTLIB
> matplotlib: 1.0.svn
> python: 2.5.2 (r252:60911, May 7 2008, 12:40:32) [GCC
> 3.4.6 20060404 (Red Hat 3.4.6-9)]
> platform: linux2
> 
> REQUIRED DEPENDENCIES
> numpy: 2.0.0.dev8055
> freetype2: 9.16.3
> 
> OPTIONAL BACKEND DEPENDENCIES
> libpng: 1.2.37
> Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
> wxPython: 2.8.6.1
> * WxAgg extension not required for wxPython >= 2.8
> Gtk+: gtk+: 2.10.9, glib: 2.16.1, pygtk: 2.10.4,
> pygobject: 2.13.1
> Mac OS X native: no
> Qt: Qt: 3.3.3, PyQt: 3.17.2
> Qt4: Qt: 4.6.2, PyQt4: 4.7.3
> Cairo: 1.4.0
> 
> OPTIONAL DATE/TIMEZONE DEPENDENCIES
> datetime: present, version unknown
> dateutil: 1.4.1
> pytz: 2008c
> 
> OPTIONAL USETEX DEPENDENCIES
> dvipng: 1.12
> ghostscript: 7.07
> latex: 3.1415926
> pdftops: 3.00
> 
> verbose-helpful:
> 
> $HOME=/home/mdroe
> CONFIGDIR=/home/mdroe/.matplotlib
> matplotlib data path 
> /home/mdroe/usr/lib/python2.5/site-packages/matplotlib/mpl-data
> loaded rc file /home/mdroe/.matplotlib/matplotlibrc
> matplotlib version 1.0.svn
> verbose.level helpful
> interactive is False
> units is False
> platform is linux2
> Using fontManager instance from /home/mdroe/.matplotlib/fontList.cache
> backend GTKAgg version 2.10.4
> findfont: Matching 
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
> 
> to Bitstream Vera Sans 
> (/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
> 
> with score of 0.000000
> 
> 
> Tomáš Faragó wrote:
> > Thanks for replying Mike,
> > I tried it on Linux as well but I ran into the same problem. Perhaps 
> > it has something to do with other needed libraries (GTK+, etc.). Can 
> > you please tell me your libraries versions? I mean GTK+, pygtk, etc. 
> > Also output produced by --verbose-helpful could be useful. Thank you.
> > Tomas.
> >
> >
> >> ------------ Pôvodná správa ------------
> >> Od: Michael Droettboom <md...@st...>
> >> Predmet: Re: [Matplotlib-users] imshow memory problem
> >> Dátum: 17.5.2010 16:48:55
> >> ----------------------------------------
> >> On Linux, I only see about an extra 24kb being used when the canvas 
> >> is added to a window vs. not adding it (i.e. commenting out the 
> >> window.add(canvas) line).
> >>
> >> In general, here's the memory usage to be expected from imshow (if 
> >> it's a floating-point, not-rgb(a) array as you have here):
> >>
> >> The original data: 4-bytes-per-pixel for float32 or 8-bytes-per-pixel 
> >> for float64 (in your example the array is float64).
> >> Intermediate float data: *if* the original is not float64, then an 
> >> intermediate float64 is created (not the case here)
> >> The colorized data: 4-bytes-per-pixel at original array size
> >> The sized data: 4-bytes-per-pixel at the scaled figure size
> >>
> >> I hope I'm not forgetting anything, but the point is that to support 
> >> high-speed rendering of plots, the memory usage is much greater than 
> >> the data itself. If your data is truly large, the usual technique is 
> >> to decimate or downsample it before passing it to matplotlib, as 
> >> you're not going to see more data points than pixels on your display 
> >> anyway.
> >>
> >> Mike
> >>
> >> Tomáš Faragó wrote:
> >> > Hello,
> >> > I am writing a GUI using GTK+ library. I have a question about axes 
> >> class
> >> imshow method memory consumtion. If I pass the imshow an array, the 
> >> resulting
> >> memory consuption is approximatelly 46 times greater than the array 
> >> size. If I
> >> do not add the canvas to a window (in a code below), the memory 
> >> consuption is
> >> "only" 8 times greater. Any tips on how to reduce the memory 
> >> consuption would be
> >> very appreciated and any explanation of how much memmory imshow 
> >> allocates too.
> >> Configuration and script are below.
> >> >
> >> > os: Windowx XP
> >> > matplotlib version: 0.99.1
> >> > downloaded from: sourceforge.net
> >> >
> >> > script:
> >> > from matplotlib.figure import Figure
> >> > from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
> >> > from pylab import rand
> >> > import gtk
> >> >
> >> > window = gtk.Window()
> >> > window.connect("destroy", gtk.main_quit)
> >> >
> >> > figure = Figure(figsize=(8,6), dpi=72)
> >> > canvas = FigureCanvasGTKAgg(figure)
> >> > axes = figure.add_subplot(111)
> >> >
> >> > window.add(canvas)
> >> >
> >> > axes.imshow(rand(1024,1024))
> >> > canvas.draw()
> >> > window.show_all()
> >> >
> >> > gtk.main()
> >> >
> >> > verbose-helpful output:
> >> > $HOME=C:\Documents and Settings\Sensej
> >> > CONFIGDIR=C:\Documents and Settings\Sensej\.matplotlib
> >> > matplotlib data path C:\Python26\lib\site-packages\matplotlib\mpl-data
> >> > loaded rc file 
> >> C:\Python26\lib\site-packages\matplotlib\mpl-data\matplotlibrc
> >> > matplotlib version 0.99.1
> >> > verbose.level helpful
> >> > interactive is False
> >> > units is False
> >> > platform is win32
> >> > Using fontManager instance from C:\Documents and
> >> Settings\Sensej\.matplotlib\fontList.cache
> >> > backend GTKAgg version 2.12.1
> >> > findfont: Matching
> >>
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
> 
> >>
> >> to Bitstream Vera Sans
> >> (C:\Python26\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf) 
> >> with
> >> score of 0.000000
> >> >
> >> > Thank you,
> >> > Tomas.
> >> >
> >> >
> >>
> ------------------------------------------------------------------------------ 
> >>
> >> >
> >> > _______________________________________________
> >> > Matplotlib-users mailing list
> >> > Mat...@li...
> >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >> > 
> >> -- 
> >> Michael Droettboom
> >> Science Software Branch
> >> Operations and Engineering Division
> >> Space Telescope Science Institute
> >> Operated by AURA for NASA
> >>
> >>
> >>
> >>
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
> 
> 
> 
> 
From: Ryan M. <rm...@gm...> - 2010年05月18日 15:06:38
On Mon, May 17, 2010 at 10:08 AM, hettling <het...@fe...> wrote:
> Dear all,
>
> I'm struggling with the following problem plotting my data:
>
> I have a figure with two panels next to each other, which I want to
> label 'A' and 'B'. I want to left-justify my panel labels, but not to
> the box that contains the plot, but to the y-axis label. I played around
> with 'text()' and 'title()', but did not find a good solution except for
> giving the coordinates manually to 'text()'. This would be very
> inconvenient though, because I have many different plots on different
> scales.
> Here is what I tried:
>
> ###Code
> import scipy
> import matplotlib.pyplot as plt
>
> fig = plt.figure()
> ax = fig.add_subplot(121)
> plt.plot(scipy.sin(scipy.arange(1,100, 0.001)))
> plt.xlabel('xlabel')
> plt.ylabel("ylabel")
> plt.text(0,1,"A", fontsize=14, transform=ax.transAxes)
>
> ax = fig.add_subplot(122)
> plt.plot(scipy.cos(scipy.arange(1,100, 0.001)))
> plt.text(0,1,"B", fontsize=14, transform=ax.transAxes)
> plt.xlabel('xlabel')
> ###End Code
>
> So the texts 'A' and 'B' should be a little bit higher and more to the
> left. The 'A' I want to align with the y-axis label of the left plot,
> the 'B' with the values of the y-axis of the right plot.
I haven't thought through the solution completely, but my intuition
says that this might be helpful:
http://matplotlib.sourceforge.net/examples/pylab_examples/anchored_artists.html
http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#anchoredartists
These examples show ways of anchoring artists (like Text) to certain
locations. It's probably your best bet for getting what you want.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Michael D. <md...@st...> - 2010年05月18日 14:19:21
It should only try to import that backend when configured to do so. You 
may need to change your matplotlibrc to point to your desired backend.
Mike
New2Python wrote:
> Thanks, must have skipped over that one - I added the statements and it has
> fixed it :) however now there is an issue elsewhere. I get the message
>
> File "matplotlib\backends\__init__.pyo", line 25, in pylab_setup
> ImportError: No module named backend_tkagg
>
> and the traceback call this
>
> from pylab import *
>
> I have _tkagg as an exclude
>
> looks like somebody else had this problem but nobody solved it
> http://mail.scipy.org/pipermail/scipy-user/2005-July/004777.html
>
> any one know how to solve this?
>
> I tried to include matplotlib.backends.backend_tkagg, then this popped up
> with a tkinter import error.
>
> Regards
>
> Marco
>
>
>
>
>
>
> New2Python wrote:
> 
>> Hi All,
>>
>> I hope someone can help, I have run into a few problems when trying to
>> execute an exe file created when I use py2exe with matplotlib.
>> I have python2.5, matplotlib v0.99.1 and py2exe from GUI2Exe v0.5.0
>> optimisation is python -OO
>> the files compile correctly however when I execute the exe I get an error
>> as shown below
>> this is an extract
>>
>> File "matplotlib\mlab.pyo", line 380, in <module>
>> TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'
>>
>> the traceback points to this line of my code
>>
>> from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
>>
>> does anyone know how to solve this, i have seen references made to numpy
>> but not matplotlib
>>
>> Regards
>>
>> Marco
>>
>>
>>
>>
>> 
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Ryan M. <rm...@gm...> - 2010年05月18日 14:17:21
On Mon, May 17, 2010 at 6:07 AM, Ruben Moor <rub...@gm...> wrote:
> Hello,
> I plot views of 3D data without axis. The plotting results usually in plenty
> of surrounding white space. Is there an easy way to get rid of it (easy
> meaning without having to keep track of the spacial extension of my 3D data)
> ?
figure.subplots_adjust() can be used to control various margins within
the figure. When saving with savefig(), you can also specify
bbox_inches='tight' which tells it to figure out the actual bounding
box of you plot for saving, which eliminates a lot of whitespace.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Michael D. <md...@st...> - 2010年05月18日 14:09:33
We went through this a few years ago on the Cairo mailing list. 
The short answer is you need to copy the fonts from mpl-data to 
C:\Windows\Fonts to correctly use Cairo.
The long answer: Cairo uses fontconfig for font lookup, which by default 
searches the system font directory (C:\Windows\Fonts). There is an 
fontconfig API to add another font directory to search, but it is not 
exposed to Python. The cairo guys don't want to expose it in pycairo 
because that API is not technically part of cairo, but there isn't a 
proper Python wrapper to fontconfig, so until one is created we're sort 
of left with our hands tied.
This is probably worthy of a FAQ in the docs.
Mike
cop...@gm... wrote:
> Hallo,
>
> I'm try to use MathTextParser output for cairo in my wxpython gui. Works well under ubunutu linux (maybe dublicated font) but fails under windows (screenshot: http://www.ubuntu-pics.de/bild/62985/auswahl_017_RC86gk.png ).
>
> How to tell cairo to use the font file from mpl-data?
>
> Here some code:
>
> from matplotlib.mathtext import MathTextParser
> from matplotlib.font_manager import ttfFontProperty
> import wx
> import wx.lib.wxcairo
> import cairo
>
> #...
> MPC = MathTextParser("Cairo")
> dc = wx.BufferedPaintDC(self)
> ctx = wx.lib.wxcairo.ContextFromDC(dc)
> #...
> width, height, descent, glyphs, rects = self.mathtext_parser.parse(r"$a_0+a_1\xi+a_2\xi^2+a_3\xi^3$",dpi,prop)
> #...
>
> for font, fontsize, s, ox, oy in glyphs:
> #...
> fontProp = ttfFontProperty(font)
> #...
> ctx.select_font_face (fontProp.name,
> self.fontangles [fontProp.style],
> self.fontweights[fontProp.weight])
>
> #...
> ctx.show_text(s.encode("utf-8"))
> #...
> #...
>
> greetz
>
> Frank
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Nick S. <N.S...@du...> - 2010年05月18日 13:56:21
Hi all,
Is there anyway of re-ploting the distribution generated by hist at a
later point? I want to call it in a subroutine and have the resulting
distributions returned so I can plot them without having to
recalculate them each time. I couldn't find anything int he online
documentation but I figured it'd be something like:
import matplotlib.pyplot as plt
hplot=plt.hist(data, bins=1000)
plt.hist(hplot)
or
plt.hist(hplot[0],bins=hplot[1])
or
plt.plot(hist)
etc, but nothing works.
-- 
Cheers,
Nick Schurch
Data Analysis Group (The Barton Group),
School of Life Sciences,
University of Dundee,
Dow St,
Dundee,
DD1 5EH,
Scotland,
UK
Tel: +44 1382 388707
Fax: +44 1382 345 893
From: Nick S. <nic...@go...> - 2010年05月18日 13:53:44
Hi all,
Is there anyway of re-ploting the distribution generated by hist at a
later point? I want to call it in a subroutine and have the resulting
distributions returned so I can plot them without having to
recalculate them each time. I couldn't find anything int he online
documentation but I figured it'd be something like:
import matplotlib.pyplot as plt
hplot=plt.hist(data, bins=1000)
plt.hist(hplot)
or
plt.hist(hplot[0],bins=hplot[1])
or
plt.plot(hist)
etc, but nothing works.
Cheers,
Nick Schurch
From: Richard H. <ric...@io...> - 2010年05月18日 12:51:21
Hi,
I wanted to plot a coastline of Scandinavia with basemap in intermediate 
resolution without lakes.
The method i found was to draw the coastlines with the plot command 
using the coastline polygons from the projection.
(see example below, the lakes are filled with a slightly darker gray for 
illustration).
Please reply, if a more condensed version (e.g. 
proj.drawcoastlines(draw_lakes=False ?) is existing.
from pylab import *
from mpl_toolkits.basemap import Basemap
proj = Basemap(projection='lcc',
 resolution='i',
 llcrnrlon=9.0,
 llcrnrlat=53.0,
 urcrnrlon=35.0,
 urcrnrlat=65.3,
 lat_0=55.0,
 lon_0=14.0)
figure()
for i,cp in enumerate(proj.coastpolygons):
 if proj.coastpolygontypes[i]<2:
 proj.plot(cp[0],cp[1],'k-')
proj.fillcontinents([0.8,0.8,0.8],lake_color=[0.75,0.75,0.75])
proj.drawmeridians(arange(12,30,4),linewidth=0.3,labels=[0,0,0,1])
proj.drawparallels(arange(54,67,2),linewidth=0.3,labels=[1,0,0,0])
show()
Richard
(i am using basemap v0.99.5)
From: New2Python <new...@li...> - 2010年05月18日 12:39:38
Thanks, must have skipped over that one - I added the statements and it has
fixed it :) however now there is an issue elsewhere. I get the message
 File "matplotlib\backends\__init__.pyo", line 25, in pylab_setup
ImportError: No module named backend_tkagg
and the traceback call this
from pylab import *
I have _tkagg as an exclude
looks like somebody else had this problem but nobody solved it
http://mail.scipy.org/pipermail/scipy-user/2005-July/004777.html
any one know how to solve this?
I tried to include matplotlib.backends.backend_tkagg, then this popped up
with a tkinter import error.
Regards
Marco
New2Python wrote:
> 
> Hi All,
> 
> I hope someone can help, I have run into a few problems when trying to
> execute an exe file created when I use py2exe with matplotlib.
> I have python2.5, matplotlib v0.99.1 and py2exe from GUI2Exe v0.5.0
> optimisation is python -OO
> the files compile correctly however when I execute the exe I get an error
> as shown below
> this is an extract
> 
> File "matplotlib\mlab.pyo", line 380, in <module>
> TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'
> 
> the traceback points to this line of my code
> 
> from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
> 
> does anyone know how to solve this, i have seen references made to numpy
> but not matplotlib
> 
> Regards
> 
> Marco
> 
> 
> 
> 
-- 
View this message in context: http://old.nabble.com/py2exe-and-matplotlib-errors-when-executing-exe-tp28589875p28595304.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Tomáš F. <sen...@em...> - 2010年05月18日 10:56:41
Thanks for replying Mike,
I tried it on Linux as well but I ran into the same problem. Perhaps it has something to do with other needed libraries (GTK+, etc.). Can you please tell me your libraries versions? I mean GTK+, pygtk, etc. Also output produced by --verbose-helpful could be useful. Thank you.
Tomas.
> ------------ Pôvodná správa ------------
> Od: Michael Droettboom <md...@st...>
> Predmet: Re: [Matplotlib-users] imshow memory problem
> Dátum: 17.5.2010 16:48:55
> ----------------------------------------
> On Linux, I only see about an extra 24kb being used when the canvas is 
> added to a window vs. not adding it (i.e. commenting out the 
> window.add(canvas) line).
> 
> In general, here's the memory usage to be expected from imshow (if it's 
> a floating-point, not-rgb(a) array as you have here):
> 
> The original data: 4-bytes-per-pixel for float32 or 8-bytes-per-pixel 
> for float64 (in your example the array is float64).
> Intermediate float data: *if* the original is not float64, then an 
> intermediate float64 is created (not the case here)
> The colorized data: 4-bytes-per-pixel at original array size
> The sized data: 4-bytes-per-pixel at the scaled figure size
> 
> I hope I'm not forgetting anything, but the point is that to support 
> high-speed rendering of plots, the memory usage is much greater than the 
> data itself. If your data is truly large, the usual technique is to 
> decimate or downsample it before passing it to matplotlib, as you're not 
> going to see more data points than pixels on your display anyway.
> 
> Mike
> 
> Tomáš Faragó wrote:
> > Hello,
> > I am writing a GUI using GTK+ library. I have a question about axes class
> imshow method memory consumtion. If I pass the imshow an array, the resulting
> memory consuption is approximatelly 46 times greater than the array size. If I
> do not add the canvas to a window (in a code below), the memory consuption is
> "only" 8 times greater. Any tips on how to reduce the memory consuption would be
> very appreciated and any explanation of how much memmory imshow allocates too.
> Configuration and script are below.
> >
> > os: Windowx XP
> > matplotlib version: 0.99.1
> > downloaded from: sourceforge.net
> >
> > script:
> > from matplotlib.figure import Figure
> > from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
> > from pylab import rand
> > import gtk
> >
> > window = gtk.Window()
> > window.connect("destroy", gtk.main_quit)
> >
> > figure = Figure(figsize=(8,6), dpi=72)
> > canvas = FigureCanvasGTKAgg(figure)
> > axes = figure.add_subplot(111)
> >
> > window.add(canvas)
> >
> > axes.imshow(rand(1024,1024))
> > canvas.draw()
> > window.show_all()
> >
> > gtk.main()
> >
> > verbose-helpful output:
> > $HOME=C:\Documents and Settings\Sensej
> > CONFIGDIR=C:\Documents and Settings\Sensej\.matplotlib
> > matplotlib data path C:\Python26\lib\site-packages\matplotlib\mpl-data
> > loaded rc file C:\Python26\lib\site-packages\matplotlib\mpl-data\matplotlibrc
> > matplotlib version 0.99.1
> > verbose.level helpful
> > interactive is False
> > units is False
> > platform is win32
> > Using fontManager instance from C:\Documents and
> Settings\Sensej\.matplotlib\fontList.cache
> > backend GTKAgg version 2.12.1
> > findfont: Matching
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
> to Bitstream Vera Sans
> (C:\Python26\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf) with
> score of 0.000000
> >
> > Thank you,
> > Tomas.
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> > 
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
> 
> 
> 
> 
From: Christoph G. <cg...@uc...> - 2010年05月17日 23:21:17
This is probably the docstring problem mentioned at the bottom of 
<http://www.py2exe.org/index.cgi/MatPlotLib>.
--
Christoph
On 5/17/2010 4:07 PM, New2Python wrote:
>
> Hi All,
>
> I hope someone can help, I have run into a few problems when trying to
> execute an exe file created when I use py2exe with matplotlib.
> I have python2.5, matplotlib v0.99.1 and py2exe from GUI2Exe v0.5.0
> optimisation is python -OO
> the files compile correctly however when I execute the exe I get an error as
> shown below
> this is an extract
>
> File "matplotlib\mlab.pyo", line 380, in<module>
> TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'
>
> the traceback points to this line of my code
>
> from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
>
> does anyone know how to solve this, i have seen references made to numpy but
> not matplotlib
>
> Regards
>
> Marco
>
From: New2Python <new...@li...> - 2010年05月17日 23:07:28
Hi All,
I hope someone can help, I have run into a few problems when trying to
execute an exe file created when I use py2exe with matplotlib.
I have python2.5, matplotlib v0.99.1 and py2exe from GUI2Exe v0.5.0
optimisation is python -OO
the files compile correctly however when I execute the exe I get an error as
shown below
this is an extract
 File "matplotlib\mlab.pyo", line 380, in <module>
TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'
the traceback points to this line of my code
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
does anyone know how to solve this, i have seen references made to numpy but
not matplotlib
Regards
Marco
-- 
View this message in context: http://old.nabble.com/py2exe-and-matplotlib-errors-when-executing-exe-tp28589875p28589875.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: <cop...@gm...> - 2010年05月17日 21:01:57
Hallo,
I'm try to use MathTextParser output for cairo in my wxpython gui. Works well under ubunutu linux (maybe dublicated font) but fails under windows (screenshot: http://www.ubuntu-pics.de/bild/62985/auswahl_017_RC86gk.png ).
How to tell cairo to use the font file from mpl-data?
Here some code:
from matplotlib.mathtext import MathTextParser
from matplotlib.font_manager import ttfFontProperty
import wx
import wx.lib.wxcairo
import cairo
#...
MPC = MathTextParser("Cairo")
dc = wx.BufferedPaintDC(self)
ctx = wx.lib.wxcairo.ContextFromDC(dc)
#...
width, height, descent, glyphs, rects = self.mathtext_parser.parse(r"$a_0+a_1\xi+a_2\xi^2+a_3\xi^3$",dpi,prop)
#...
for font, fontsize, s, ox, oy in glyphs:
 #...
 fontProp = ttfFontProperty(font)
 #...
 ctx.select_font_face (fontProp.name,
 self.fontangles [fontProp.style],
 self.fontweights[fontProp.weight])
 #...
 ctx.show_text(s.encode("utf-8"))
 #...
#...
greetz
Frank
From: Eric F. <ef...@ha...> - 2010年05月17日 18:44:25
On 05/17/2010 06:32 AM, Reckoner wrote:
> Hi,
>
> Using the following
>
> >>> pcolor(x,y,z,shading='interp')
>
> is it possible to change the interpolation method used? I noticed that
> there are set_interpolation methods for images created using
>
> In [83]: h = imshow( z)
>
> In [84]: h.set_interpolation?
> Type: instancemethod
> Base Class: <type 'instancemethod'>
> String Form: <bound method AxesImage.set_interpolation of
> <matplotlib.image.AxesImage object at 0x047B27D0>>
> Namespace: Interactive
> File: c:\python26\lib\site-packages\matplotlib\image.py
> Definition: h.set_interpolation(self, s)
> Docstring:
> Set the interpolation method the image uses when resizing.
>
> ACCEPTS: ['nearest' | 'bilinear' | 'bicubic' | 'spline16' |
> 'spline36' | 'hanning' | 'hamming' | 'hermite' | 'kaiser' |
> 'quadric' | 'catrom' | 'gaussian' | 'bessel' | 'mitchell' |
> 'sinc' | 'lanczos' | ]
>
> are these available for pcolor?
No. Pcolor simply fills quadrilaterals. There is a NonUniformImage 
class that accepts image interpolation options. I don't think anyone 
has ever gotten around to giving it a nice interface via an Axes method 
or pyplot function, but there is an example of its use:
http://matplotlib.sourceforge.net/examples/pylab_examples/image_nonuniform.html
In the svn version of mpl there is also a gouraud shading option to 
pcolormesh, which provides interpolation on non-rectangular grids.
Eric
From: Alan G I. <ala...@gm...> - 2010年05月17日 17:07:51
On 5/17/2010 11:31 AM, Sandy Ydnas wrote:
> it gets stuck in all tested by me IDE inclusing Komodo,pythonxy
http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show
hth,
Alan Isaac
From: Malte D. <mal...@we...> - 2010年05月17日 16:49:31
Hi,
> Is there any API to draw the lines between the labels?
> I guess its not possible with this tool.
You could use the ticks' properties (one of their children is a 
matplotlib.lines.Line2D instance which you could modify to your wishes). The 
second possibility is see is you put a box with only two drawn borders around 
the labels, which I think might lead to problems.
So if you want to inspect, what you can do with those ticks you can use
pyplot.getp(object_to_inspect) and pyplot.setp(object_to_inspect) aswell as
dir(object_to_inspect).
I mostly do this by having an open python shell where I create and check out 
the properties I want to work on and a little script I modify to check out how 
the changes affect the plot. What I did looked something like this:
>>> from matplotlib import pyplot
>>> fig = pyplot.figure() 
>>> p = fig.add_subplot(111)
>>> p.yaxis.set_ticks([3,4,5]) 
[<matplotlib.axis.YTick object at 0xa3b580c>, <matplotlib.axis.YTick object at 
0xa6861cc>, <matplotlib.axis.YTick object at 0xa6a858c>]
>>> m = p.yaxis.set_ticks([3,4,5])
>>> dir(m[0])
['__class__', '__d..........., 'get_children', 'get_cli.......]
>>> pyplot.getp(m[0])
 alpha = 1.0
...
 children = [<matplotlib.lines.Line2D object at 0xa3b5fac>, <m...
...
>>> m[0].get_children()
>>> pyplot.getp(m[0].get_children()[0])
>>> pyplot.setp(m[0].get_children()[0])
and if you don't have the return of creating the ticks ("m" in this case) then 
you can get then using
>>> p.yaxis.get_children()
[<matplotlib.text.Text object at 0xaa80a6c>, <matplotlib.axis.YTick object at 
0xaa9494c>, <matplotlib.axis.YTick object at 0xaa80a0c>, 
<matplotlib.axis.YTick object at 0xaab650c>, <matplotlib.axis.YTick object at 
0xaab652c>, <matplotlib.axis.YTick object at 0xaab68ec>, 
<matplotlib.axis.YTick object at 0xaab6cec>]
Hope it helps,
Malte
From: Reckoner <rec...@gm...> - 2010年05月17日 16:32:31
Hi,
Using the following
>>> pcolor(x,y,z,shading='interp')
is it possible to change the interpolation method used? I noticed that there
are set_interpolation methods for images created using
In [83]: h = imshow( z)
In [84]: h.set_interpolation?
Type: instancemethod
Base Class: <type 'instancemethod'>
String Form: <bound method AxesImage.set_interpolation of
<matplotlib.image.AxesImage object at 0x047B27D0>>
Namespace: Interactive
File: c:\python26\lib\site-packages\matplotlib\image.py
Definition: h.set_interpolation(self, s)
Docstring:
 Set the interpolation method the image uses when resizing.
ACCEPTS: ['nearest' | 'bilinear' | 'bicubic' | 'spline16' |
 'spline36' | 'hanning' | 'hamming' | 'hermite' | 'kaiser' |
 'quadric' | 'catrom' | 'gaussian' | 'bessel' | 'mitchell' |
 'sinc' | 'lanczos' | ]
are these available for pcolor?
Thanks!
From: rajtendulkar <pra...@gm...> - 2010年05月17日 16:08:59
Is there any API to draw the lines between the labels?
I guess its not possible with this tool.
-- 
View this message in context: http://old.nabble.com/Formatting-X-axis-tp28579609p28585415.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2010年05月17日 16:03:02
> Wingware is only example that commerciale soft can not solve this problem
> never,
What does
 >>> matplotlib.get_backend()
report? According to http://www.wingware.com/doc/howtos/matplotlib
they are assuming TkAgg. You may also want to read the suggestions at
 http://matplotlib.sourceforge.net/users/shell.html
for advice on how to use matplotlib interactively from the command
shell in an IDE. Basically, you need to make sure your "backend"
corresponds to the GUI and interactive mode is set to True. See also
 http://matplotlib.sourceforge.net/users/customizing.html
 http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
JDH
From: Sandy Y. <cd...@li...> - 2010年05月17日 15:31:17
 
Mike,
 
Wingware is only example that commerciale soft can not solv ethis problem never,
 
it gets stuck in all tested by me IDE inclusing Komodo,pythonxy,...
 
 
is is general problem if Matplotlib even staertd in book as I mentined previoulsy 
 
it is impossible after show() to continue debug in IDE's for 
> > > example wingware or pythonxy as stated in Beginning Python 
> > > Visualization - Crafting Visual Transformation Scripts
> > > (2009)
> > > page 187
> > > 
> > > Note If you're not using matplotlib interactively in Python, be 
> > > sure to call the function show() after all graphs have been 
> > > generated, as it enters a user interface main loop that will stop 
> > > execution of the rest of your code. The reason behind this 
> > > behavior is that matplotlib is designed to be embedded in a GUI as 
> > > well.
> > > In Windows, if you're working from interactive Python, you need 
> > > only issue show() once; close the figures (or figures) to return 
> > > to the shell. Subsequent plots will be drawn automatically without 
> > > issuing show(), and you'll be able to plot graphs interactively.
> > > 
 
 
 
but no one IDE uses ipython
Sandy
 
 
 Personally, I don't use Wingware, so I don't know any specifics about 
> using matplotlib in that environment. You could try asking this 
> question on a Wingware-related mailing list.
> 
> Mike
 
> From: mat...@li...
> Subject: Matplotlib-users Digest, Vol 48, Issue 23
> To: mat...@li...
> Date: 2010年5月17日 15:06:07 +0000
> 
> Send Matplotlib-users mailing list submissions to
> mat...@li...
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> or, via email, send a message with subject or body 'help' to
> mat...@li...
> 
> You can reach the person managing the list at
> mat...@li...
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Matplotlib-users digest..."
> 
> 
> Today's Topics:
> 
> 1. Re: imshow memory problem (Michael Droettboom)
> 2. FW: Matplotlib-users Digest, Vol 48, Issue 19 (Sandy Ydnas)
> 3. align title of subplot with ylabel (hettling)
> 4. Re: FW: Matplotlib-users Digest, Vol 48, Issue 19
> (Michael Droettboom)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: 2010年5月17日 10:47:41 -0400
> From: Michael Droettboom <md...@st...>
> Subject: Re: [Matplotlib-users] imshow memory problem
> To: Tom?? Farag? <sen...@em...>
> Cc: mat...@li...
> Message-ID: <4BF...@st...>
> Content-Type: text/plain; charset=windows-1252; format=flowed
> 
> On Linux, I only see about an extra 24kb being used when the canvas is 
> added to a window vs. not adding it (i.e. commenting out the 
> window.add(canvas) line).
> 
> In general, here's the memory usage to be expected from imshow (if it's 
> a floating-point, not-rgb(a) array as you have here):
> 
> The original data: 4-bytes-per-pixel for float32 or 8-bytes-per-pixel 
> for float64 (in your example the array is float64).
> Intermediate float data: *if* the original is not float64, then an 
> intermediate float64 is created (not the case here)
> The colorized data: 4-bytes-per-pixel at original array size
> The sized data: 4-bytes-per-pixel at the scaled figure size
> 
> I hope I'm not forgetting anything, but the point is that to support 
> high-speed rendering of plots, the memory usage is much greater than the 
> data itself. If your data is truly large, the usual technique is to 
> decimate or downsample it before passing it to matplotlib, as you're not 
> going to see more data points than pixels on your display anyway.
> 
> Mike
> 
> Tom?? Farag? wrote:
> > Hello,
> > I am writing a GUI using GTK+ library. I have a question about axes class imshow method memory consumtion. If I pass the imshow an array, the resulting memory consuption is approximatelly 46 times greater than the array size. If I do not add the canvas to a window (in a code below), the memory consuption is "only" 8 times greater. Any tips on how to reduce the memory consuption would be very appreciated and any explanation of how much memmory imshow allocates too. Configuration and script are below.
> >
> > os: Windowx XP
> > matplotlib version: 0.99.1
> > downloaded from: sourceforge.net
> >
> > script:
> > from matplotlib.figure import Figure
> > from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
> > from pylab import rand
> > import gtk
> >
> > window = gtk.Window()
> > window.connect("destroy", gtk.main_quit)
> >
> > figure = Figure(figsize=(8,6), dpi=72)
> > canvas = FigureCanvasGTKAgg(figure)
> > axes = figure.add_subplot(111)
> >
> > window.add(canvas)
> >
> > axes.imshow(rand(1024,1024))
> > canvas.draw()
> > window.show_all()
> >
> > gtk.main()
> >
> > verbose-helpful output:
> > $HOME=C:\Documents and Settings\Sensej
> > CONFIGDIR=C:\Documents and Settings\Sensej\.matplotlib
> > matplotlib data path C:\Python26\lib\site-packages\matplotlib\mpl-data
> > loaded rc file C:\Python26\lib\site-packages\matplotlib\mpl-data\matplotlibrc
> > matplotlib version 0.99.1
> > verbose.level helpful
> > interactive is False
> > units is False
> > platform is win32
> > Using fontManager instance from C:\Documents and Settings\Sensej\.matplotlib\fontList.cache
> > backend GTKAgg version 2.12.1
> > findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (C:\Python26\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf) with score of 0.000000
> >
> > Thank you,
> > Tomas.
> >
> > ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> > 
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
> 
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: 2010年5月17日 19:48:50 +0500
> From: Sandy Ydnas <cd...@li...>
> Subject: [Matplotlib-users] FW: Matplotlib-users Digest, Vol 48, Issue
> 19
> To: <mat...@li...>
> Message-ID: <COL...@ph...l>
> Content-Type: text/plain; charset="koi8-r"
> 
> 
> 
> 
> 
> Hello friends,
> 
> 
> 
> no body can answer on first obvious question of Matplotlib???!!!!!
> 
> 
> 
> 
> Sandy
> 
> 
> > From: mat...@li...
> > Subject: Matplotlib-users Digest, Vol 48, Issue 19
> > To: mat...@li...
> > Date: 2010年5月13日 18:18:52 +0000
> > 
> > Send Matplotlib-users mailing list submissions to
> > mat...@li...
> > 
> > To subscribe or unsubscribe via the World Wide Web, visit
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> > or, via email, send a message with subject or body 'help' to
> > mat...@li...
> > 
> > You can reach the person managing the list at
> > mat...@li...
> > 
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Matplotlib-users digest..."
> > 
> > 
> > Today's Topics:
> > 
> > 1. debugging process gets stuck with matpltlib after show()
> > (Sandy Sandy)
> > 
> > 
> > ----------------------------------------------------------------------
> > 
> > Message: 1
> > Date: 2010年5月13日 23:18:42 +0500
> > From: Sandy Sandy <cd...@li...>
> > Subject: [Matplotlib-users] debugging process gets stuck with
> > matpltlib after show()
> > To: <mat...@li...>
> > Message-ID: <COL...@ph...l>
> > Content-Type: text/plain; charset="windows-1252"
> > 
> > 
> > 
> > 
> > Hi all,
> > I am new born in Python ( 1 week old)
> > 
> > 
> > 
> > Can you pls help to understand the basic concept of
> > matpltlib interacting with Python
> > 
> > 
> > 
> > the mutter is:
> > 
> > during debugging the debug processes stacks when fig is created
> > 
> > for example, in code
> > 
> > 
> > 
> > 
> > 
> > import matplotlib.pyplot as plt
> > 
> > from pylab import *
> > 
> > x= 23;
> > 
> > y = 111111;
> > 
> > print(23456)
> > 
> > plt.plot(range(10))
> > 
> > plot([1,2,3])
> > 
> > show()
> > 
> > print(11111111)
> > 
> > a=888
> > 
> > 
> > 
> > it is impossible after show() to continue debug in any IDE for example Wingwar
> > or pythonxy 
> > 
> > as stated in
> > 
> > Beginning Python Visualization - Crafting Visual Transformation Scripts (2009)
> > 
> > page 187
> > 
> > 
> > 
> > Note If you?re not using matplotlib interactively in Python, be sure
> > 
> > to call the function show() after all
> > 
> > graphs have been generated, as it enters a user interface main loop
> > 
> > that will stop execution of the rest of
> > 
> > your code. The reason behind this behavior is that matplotlib is
> > 
> > designed to be embedded in a GUI as well.
> > 
> > In Windows, if you?re working from interactive Python, you need only
> > 
> > issue show() once; close the figures
> > 
> > (or figures) to return to the shell. Subsequent plots will be drawn
> > 
> > automatically without issuing show(), and
> > 
> > you?ll be able to plot graphs interactively.
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > I tried the code 
> > 
> > 
> > 
> > 
> > 
> > with threads
> > 
> > as suggested in 
> > 
> > http://matplotlib.sourceforge.net/users/shell.html
> > 
> > 
> > 
> > code
> > taken from people
> > from wingware
> > 
> > http://www.wingware.com/doc/howtos/matplotlib
> > 
> > 
> > 
> > 
> > 
> > from threading import Timer
> > 
> > t = Timer(0, show)
> > 
> > t.start()
> > 
> > 
> > 
> > but still debugging process gets
> > stuck...
> > 
> > 
> > import
> > matplotlib as mpl
> > 
> > from
> > pylab import plot,show,close,ion
> > 
> > x
> > = range(10)
> > 
> > plot(x)
> > 
> > 'show()'
> > 
> > from
> > threading import Timer
> > 
> > t
> > = Timer(0, show)
> > 
> > t.start()
> > 
> > 'ion()
> > the same result with or not'
> > 
> > a
> > = 1222233
> > 
> > y
> > = [2, 8, 3, 9, 4]
> > 
> > plot(y)
> > 
> > 
> > 
> > zz=
> > 12346
> > 
> > print(44444)
> > 
> > 
> > 
> > Best Regards
> > 
> > Sandy
> > 
> > 
> > _________________________________________________________________
> > Hotmail: Trusted email with Microsoft?s powerful SPAM protection.
> > https://signup.live.com/signup.aspx?id=60969
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > 
> > ------------------------------
> > 
> > ------------------------------------------------------------------------------
> > 
> > 
> > 
> > ------------------------------
> > 
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> > 
> > 
> > End of Matplotlib-users Digest, Vol 48, Issue 19
> > ************************************************
> 
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> https://signup.live.com/signup.aspx?id=60969
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> Message: 3
> Date: 2010年5月17日 17:08:17 +0200
> From: hettling <het...@fe...>
> Subject: [Matplotlib-users] align title of subplot with ylabel
> To: mat...@li...
> Message-ID: <1274108897.30154.11.camel@meerschwein>
> Content-Type: text/plain; charset="UTF-8"
> 
> Dear all,
> 
> I'm struggling with the following problem plotting my data:
> 
> I have a figure with two panels next to each other, which I want to
> label 'A' and 'B'. I want to left-justify my panel labels, but not to
> the box that contains the plot, but to the y-axis label. I played around
> with 'text()' and 'title()', but did not find a good solution except for
> giving the coordinates manually to 'text()'. This would be very
> inconvenient though, because I have many different plots on different
> scales.
> Here is what I tried:
> 
> ###Code
> import scipy
> import matplotlib.pyplot as plt
> 
> fig = plt.figure()
> ax = fig.add_subplot(121)
> plt.plot(scipy.sin(scipy.arange(1,100, 0.001)))
> plt.xlabel('xlabel')
> plt.ylabel("ylabel")
> plt.text(0,1,"A", fontsize=14, transform=ax.transAxes) 
> 
> ax = fig.add_subplot(122)
> plt.plot(scipy.cos(scipy.arange(1,100, 0.001)))
> plt.text(0,1,"B", fontsize=14, transform=ax.transAxes)
> plt.xlabel('xlabel')
> ###End Code
> 
> So the texts 'A' and 'B' should be a little bit higher and more to the
> left. The 'A' I want to align with the y-axis label of the left plot,
> the 'B' with the values of the y-axis of the right plot. 
> 
> I hope my question is clear, I will appreciate any help!
> 
> Thanks in advance,
> 
> Hannes 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: 2010年5月17日 11:05:58 -0400
> From: Michael Droettboom <md...@st...>
> Subject: Re: [Matplotlib-users] FW: Matplotlib-users Digest, Vol 48,
> Issue 19
> To: Sandy Ydnas <cd...@li...>
> Cc: mat...@li...
> Message-ID: <4BF...@st...>
> Content-Type: text/plain; charset=KOI8-R; format=flowed
> 
> Personally, I don't use Wingware, so I don't know any specifics about 
> using matplotlib in that environment. You could try asking this 
> question on a Wingware-related mailing list.
> 
> Mike
> 
> Sandy Ydnas wrote:
> >
> > 
> > Hello friends,
> > 
> > no body can answer on first obvious question of Matplotlib???!!!!!
> >
> > 
> > Sandy
> > 
> >
> > > From: mat...@li...
> > > Subject: Matplotlib-users Digest, Vol 48, Issue 19
> > > To: mat...@li...
> > > Date: 2010年5月13日 18:18:52 +0000
> > >
> > > Send Matplotlib-users mailing list submissions to
> > > mat...@li...
> > >
> > > To subscribe or unsubscribe via the World Wide Web, visit
> > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> > > or, via email, send a message with subject or body 'help' to
> > > mat...@li...
> > >
> > > You can reach the person managing the list at
> > > mat...@li...
> > >
> > > When replying, please edit your Subject line so it is more specific
> > > than "Re: Contents of Matplotlib-users digest..."
> > >
> > >
> > > Today's Topics:
> > >
> > > 1. debugging process gets stuck with matpltlib after show()
> > > (Sandy Sandy)
> > >
> > >
> > > ----------------------------------------------------------------------
> > >
> > > Message: 1
> > > Date: 2010年5月13日 23:18:42 +0500
> > > From: Sandy Sandy <cd...@li...>
> > > Subject: [Matplotlib-users] debugging process gets stuck with
> > > matpltlib after show()
> > > To: <mat...@li...>
> > > Message-ID: <COL...@ph...l>
> > > Content-Type: text/plain; charset="windows-1252"
> > >
> > >
> > >
> > >
> > > Hi all,
> > > I am new born in Python ( 1 week old)
> > >
> > >
> > >
> > > Can you pls help to understand the basic concept of
> > > matpltlib interacting with Python
> > >
> > >
> > >
> > > the mutter is:
> > >
> > > during debugging the debug processes stacks when fig is created
> > >
> > > for example, in code
> > >
> > >
> > >
> > >
> > >
> > > import matplotlib.pyplot as plt
> > >
> > > from pylab import *
> > >
> > > x= 23;
> > >
> > > y = 111111;
> > >
> > > print(23456)
> > >
> > > plt.plot(range(10))
> > >
> > > plot([1,2,3])
> > >
> > > show()
> > >
> > > print(11111111)
> > >
> > > a=888
> > >
> > >
> > >
> > > it is impossible after show() to continue debug in any IDE for 
> > example Wingwar
> > > or pythonxy
> > >
> > > as stated in
> > >
> > > Beginning Python Visualization - Crafting Visual Transformation 
> > Scripts (2009)
> > >
> > > page 187
> > >
> > >
> > >
> > > Note If you?re not using matplotlib interactively in Python, be sure
> > >
> > > to call the function show() after all
> > >
> > > graphs have been generated, as it enters a user interface main loop
> > >
> > > that will stop execution of the rest of
> > >
> > > your code. The reason behind this behavior is that matplotlib is
> > >
> > > designed to be embedded in a GUI as well.
> > >
> > > In Windows, if you?re working from interactive Python, you need only
> > >
> > > issue show() once; close the figures
> > >
> > > (or figures) to return to the shell. Subsequent plots will be drawn
> > >
> > > automatically without issuing show(), and
> > >
> > > you?ll be able to plot graphs interactively.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > I tried the code
> > >
> > >
> > >
> > >
> > >
> > > with threads
> > >
> > > as suggested in
> > >
> > > http://matplotlib.sourceforge.net/users/shell.html
> > >
> > >
> > >
> > > code
> > > taken from people
> > > from wingware
> > >
> > > http://www.wingware.com/doc/howtos/matplotlib
> > >
> > >
> > >
> > >
> > >
> > > from threading import Timer
> > >
> > > t = Timer(0, show)
> > >
> > > t.start()
> > >
> > >
> > >
> > > but still debugging process gets
> > > stuck...
> > >
> > >
> > > import
> > > matplotlib as mpl
> > >
> > > from
> > > pylab import plot,show,close,ion
> > >
> > > x
> > > = range(10)
> > >
> > > plot(x)
> > >
> > > 'show()'
> > >
> > > from
> > > threading import Timer
> > >
> > > t
> > > = Timer(0, show)
> > >
> > > t.start()
> > >
> > > 'ion()
> > > the same result with or not'
> > >
> > > a
> > > = 1222233
> > >
> > > y
> > > = [2, 8, 3, 9, 4]
> > >
> > > plot(y)
> > >
> > >
> > >
> > > zz=
> > > 12346
> > >
> > > print(44444)
> > >
> > >
> > >
> > > Best Regards
> > >
> > > Sandy
> > >
> > >
> > > _________________________________________________________________
> > > Hotmail: Trusted email with Microsoft?s powerful SPAM protection.
> > > https://signup.live.com/signup.aspx?id=60969
> > > -------------- next part --------------
> > > An HTML attachment was scrubbed...
> > >
> > > ------------------------------
> > >
> > > 
> > ------------------------------------------------------------------------------
> > >
> > >
> > >
> > > ------------------------------
> > >
> > > _______________________________________________
> > > Matplotlib-users mailing list
> > > Mat...@li...
> > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> > >
> > >
> > > End of Matplotlib-users Digest, Vol 48, Issue 19
> > > ************************************************
> >
> > ------------------------------------------------------------------------
> > Hotmail: Powerful Free email with security by Microsoft. Get it now. 
> > <https://signup.live.com/signup.aspx?id=60969>
> > ------------------------------------------------------------------------
> >
> > ------------------------------------------------------------------------------
> >
> > 
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> > 
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
> 
> 
> 
> 
> ------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> End of Matplotlib-users Digest, Vol 48, Issue 23
> ************************************************
 		 	 		 
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969 
From: Michael D. <md...@st...> - 2010年05月17日 15:06:06
Personally, I don't use Wingware, so I don't know any specifics about 
using matplotlib in that environment. You could try asking this 
question on a Wingware-related mailing list.
Mike
Sandy Ydnas wrote:
>
> 
> Hello friends,
> 
> no body can answer on first obvious question of Matplotlib???!!!!!
>
> 
> Sandy
> 
>
> > From: mat...@li...
> > Subject: Matplotlib-users Digest, Vol 48, Issue 19
> > To: mat...@li...
> > Date: 2010年5月13日 18:18:52 +0000
> >
> > Send Matplotlib-users mailing list submissions to
> > mat...@li...
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> > or, via email, send a message with subject or body 'help' to
> > mat...@li...
> >
> > You can reach the person managing the list at
> > mat...@li...
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Matplotlib-users digest..."
> >
> >
> > Today's Topics:
> >
> > 1. debugging process gets stuck with matpltlib after show()
> > (Sandy Sandy)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: 2010年5月13日 23:18:42 +0500
> > From: Sandy Sandy <cd...@li...>
> > Subject: [Matplotlib-users] debugging process gets stuck with
> > matpltlib after show()
> > To: <mat...@li...>
> > Message-ID: <COL...@ph...l>
> > Content-Type: text/plain; charset="windows-1252"
> >
> >
> >
> >
> > Hi all,
> > I am new born in Python ( 1 week old)
> >
> >
> >
> > Can you pls help to understand the basic concept of
> > matpltlib interacting with Python
> >
> >
> >
> > the mutter is:
> >
> > during debugging the debug processes stacks when fig is created
> >
> > for example, in code
> >
> >
> >
> >
> >
> > import matplotlib.pyplot as plt
> >
> > from pylab import *
> >
> > x= 23;
> >
> > y = 111111;
> >
> > print(23456)
> >
> > plt.plot(range(10))
> >
> > plot([1,2,3])
> >
> > show()
> >
> > print(11111111)
> >
> > a=888
> >
> >
> >
> > it is impossible after show() to continue debug in any IDE for 
> example Wingwar
> > or pythonxy
> >
> > as stated in
> >
> > Beginning Python Visualization - Crafting Visual Transformation 
> Scripts (2009)
> >
> > page 187
> >
> >
> >
> > Note If you?re not using matplotlib interactively in Python, be sure
> >
> > to call the function show() after all
> >
> > graphs have been generated, as it enters a user interface main loop
> >
> > that will stop execution of the rest of
> >
> > your code. The reason behind this behavior is that matplotlib is
> >
> > designed to be embedded in a GUI as well.
> >
> > In Windows, if you?re working from interactive Python, you need only
> >
> > issue show() once; close the figures
> >
> > (or figures) to return to the shell. Subsequent plots will be drawn
> >
> > automatically without issuing show(), and
> >
> > you?ll be able to plot graphs interactively.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > I tried the code
> >
> >
> >
> >
> >
> > with threads
> >
> > as suggested in
> >
> > http://matplotlib.sourceforge.net/users/shell.html
> >
> >
> >
> > code
> > taken from people
> > from wingware
> >
> > http://www.wingware.com/doc/howtos/matplotlib
> >
> >
> >
> >
> >
> > from threading import Timer
> >
> > t = Timer(0, show)
> >
> > t.start()
> >
> >
> >
> > but still debugging process gets
> > stuck...
> >
> >
> > import
> > matplotlib as mpl
> >
> > from
> > pylab import plot,show,close,ion
> >
> > x
> > = range(10)
> >
> > plot(x)
> >
> > 'show()'
> >
> > from
> > threading import Timer
> >
> > t
> > = Timer(0, show)
> >
> > t.start()
> >
> > 'ion()
> > the same result with or not'
> >
> > a
> > = 1222233
> >
> > y
> > = [2, 8, 3, 9, 4]
> >
> > plot(y)
> >
> >
> >
> > zz=
> > 12346
> >
> > print(44444)
> >
> >
> >
> > Best Regards
> >
> > Sandy
> >
> >
> > _________________________________________________________________
> > Hotmail: Trusted email with Microsoft?s powerful SPAM protection.
> > https://signup.live.com/signup.aspx?id=60969
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> >
> > ------------------------------
> >
> > 
> ------------------------------------------------------------------------------
> >
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> >
> > End of Matplotlib-users Digest, Vol 48, Issue 19
> > ************************************************
>
> ------------------------------------------------------------------------
> Hotmail: Powerful Free email with security by Microsoft. Get it now. 
> <https://signup.live.com/signup.aspx?id=60969>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
>
> 
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: hettling <het...@fe...> - 2010年05月17日 14:54:07
Dear all,
I'm struggling with the following problem plotting my data:
I have a figure with two panels next to each other, which I want to
label 'A' and 'B'. I want to left-justify my panel labels, but not to
the box that contains the plot, but to the y-axis label. I played around
with 'text()' and 'title()', but did not find a good solution except for
giving the coordinates manually to 'text()'. This would be very
inconvenient though, because I have many different plots on different
scales.
Here is what I tried:
###Code
import scipy
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(121)
plt.plot(scipy.sin(scipy.arange(1,100, 0.001)))
plt.xlabel('xlabel')
plt.ylabel("ylabel")
plt.text(0,1,"A", fontsize=14, transform=ax.transAxes) 
ax = fig.add_subplot(122)
plt.plot(scipy.cos(scipy.arange(1,100, 0.001)))
plt.text(0,1,"B", fontsize=14, transform=ax.transAxes)
plt.xlabel('xlabel')
###End Code
So the texts 'A' and 'B' should be a little bit higher and more to the
left. The 'A' I want to align with the y-axis label of the left plot,
the 'B' with the values of the y-axis of the right plot. 
I hope my question is clear, I will appreciate any help!
Thanks in advance,
Hannes 
From: Sandy Y. <cd...@li...> - 2010年05月17日 14:48:59
 
 Hello friends,
 
no body can answer on first obvious question of Matplotlib???!!!!!
 
Sandy
 
> From: mat...@li...
> Subject: Matplotlib-users Digest, Vol 48, Issue 19
> To: mat...@li...
> Date: 2010年5月13日 18:18:52 +0000
> 
> Send Matplotlib-users mailing list submissions to
> mat...@li...
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> or, via email, send a message with subject or body 'help' to
> mat...@li...
> 
> You can reach the person managing the list at
> mat...@li...
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Matplotlib-users digest..."
> 
> 
> Today's Topics:
> 
> 1. debugging process gets stuck with matpltlib after show()
> (Sandy Sandy)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: 2010年5月13日 23:18:42 +0500
> From: Sandy Sandy <cd...@li...>
> Subject: [Matplotlib-users] debugging process gets stuck with
> matpltlib after show()
> To: <mat...@li...>
> Message-ID: <COL...@ph...l>
> Content-Type: text/plain; charset="windows-1252"
> 
> 
> 
> 
> Hi all,
> I am new born in Python ( 1 week old)
> 
> 
> 
> Can you pls help to understand the basic concept of
> matpltlib interacting with Python
> 
> 
> 
> the mutter is:
> 
> during debugging the debug processes stacks when fig is created
> 
> for example, in code
> 
> 
> 
> 
> 
> import matplotlib.pyplot as plt
> 
> from pylab import *
> 
> x= 23;
> 
> y = 111111;
> 
> print(23456)
> 
> plt.plot(range(10))
> 
> plot([1,2,3])
> 
> show()
> 
> print(11111111)
> 
> a=888
> 
> 
> 
> it is impossible after show() to continue debug in any IDE for example Wingwar
> or pythonxy 
> 
> as stated in
> 
> Beginning Python Visualization - Crafting Visual Transformation Scripts (2009)
> 
> page 187
> 
> 
> 
> Note If you?re not using matplotlib interactively in Python, be sure
> 
> to call the function show() after all
> 
> graphs have been generated, as it enters a user interface main loop
> 
> that will stop execution of the rest of
> 
> your code. The reason behind this behavior is that matplotlib is
> 
> designed to be embedded in a GUI as well.
> 
> In Windows, if you?re working from interactive Python, you need only
> 
> issue show() once; close the figures
> 
> (or figures) to return to the shell. Subsequent plots will be drawn
> 
> automatically without issuing show(), and
> 
> you?ll be able to plot graphs interactively.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> I tried the code 
> 
> 
> 
> 
> 
> with threads
> 
> as suggested in 
> 
> http://matplotlib.sourceforge.net/users/shell.html
> 
> 
> 
> code
> taken from people
> from wingware
> 
> http://www.wingware.com/doc/howtos/matplotlib
> 
> 
> 
> 
> 
> from threading import Timer
> 
> t = Timer(0, show)
> 
> t.start()
> 
> 
> 
> but still debugging process gets
> stuck...
> 
> 
> import
> matplotlib as mpl
> 
> from
> pylab import plot,show,close,ion
> 
> x
> = range(10)
> 
> plot(x)
> 
> 'show()'
> 
> from
> threading import Timer
> 
> t
> = Timer(0, show)
> 
> t.start()
> 
> 'ion()
> the same result with or not'
> 
> a
> = 1222233
> 
> y
> = [2, 8, 3, 9, 4]
> 
> plot(y)
> 
> 
> 
> zz=
> 12346
> 
> print(44444)
> 
> 
> 
> Best Regards
> 
> Sandy
> 
> 
> _________________________________________________________________
> Hotmail: Trusted email with Microsoft?s powerful SPAM protection.
> https://signup.live.com/signup.aspx?id=60969
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> End of Matplotlib-users Digest, Vol 48, Issue 19
> ************************************************
 		 	 		 
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969 
From: Michael D. <md...@st...> - 2010年05月17日 14:47:51
On Linux, I only see about an extra 24kb being used when the canvas is 
added to a window vs. not adding it (i.e. commenting out the 
window.add(canvas) line).
In general, here's the memory usage to be expected from imshow (if it's 
a floating-point, not-rgb(a) array as you have here):
The original data: 4-bytes-per-pixel for float32 or 8-bytes-per-pixel 
for float64 (in your example the array is float64).
Intermediate float data: *if* the original is not float64, then an 
intermediate float64 is created (not the case here)
The colorized data: 4-bytes-per-pixel at original array size
The sized data: 4-bytes-per-pixel at the scaled figure size
I hope I'm not forgetting anything, but the point is that to support 
high-speed rendering of plots, the memory usage is much greater than the 
data itself. If your data is truly large, the usual technique is to 
decimate or downsample it before passing it to matplotlib, as you're not 
going to see more data points than pixels on your display anyway.
Mike
Tomáš Faragó wrote:
> Hello,
> I am writing a GUI using GTK+ library. I have a question about axes class imshow method memory consumtion. If I pass the imshow an array, the resulting memory consuption is approximatelly 46 times greater than the array size. If I do not add the canvas to a window (in a code below), the memory consuption is "only" 8 times greater. Any tips on how to reduce the memory consuption would be very appreciated and any explanation of how much memmory imshow allocates too. Configuration and script are below.
>
> os: Windowx XP
> matplotlib version: 0.99.1
> downloaded from: sourceforge.net
>
> script:
> from matplotlib.figure import Figure
> from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
> from pylab import rand
> import gtk
>
> window = gtk.Window()
> window.connect("destroy", gtk.main_quit)
>
> figure = Figure(figsize=(8,6), dpi=72)
> canvas = FigureCanvasGTKAgg(figure)
> axes = figure.add_subplot(111)
>
> window.add(canvas)
>
> axes.imshow(rand(1024,1024))
> canvas.draw()
> window.show_all()
>
> gtk.main()
>
> verbose-helpful output:
> $HOME=C:\Documents and Settings\Sensej
> CONFIGDIR=C:\Documents and Settings\Sensej\.matplotlib
> matplotlib data path C:\Python26\lib\site-packages\matplotlib\mpl-data
> loaded rc file C:\Python26\lib\site-packages\matplotlib\mpl-data\matplotlibrc
> matplotlib version 0.99.1
> verbose.level helpful
> interactive is False
> units is False
> platform is win32
> Using fontManager instance from C:\Documents and Settings\Sensej\.matplotlib\fontList.cache
> backend GTKAgg version 2.12.1
> findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (C:\Python26\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf) with score of 0.000000
>
> Thank you,
> Tomas.
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John H. <jd...@gm...> - 2010年05月17日 13:41:31
On Mon, May 17, 2010 at 8:28 AM, Craig Lyndon <c.a...@gm...> wrote:
> Hi All,
>
> Im new to matplotlib, and I love it, but I have a question about the
> Licence agreement.
> I am wanting to develop a commercial closed source application for my
> company using python and matplotlib.
>
> I have tried reading the Licence agreement, but have trouble understanding it.
> Could someone please tell me under what conditions I can use
> matplotlib in a closed source application?
The license itself is the ultimate reference, but in a nutshell, you
are free to use matplotlib in a commercial, closed source application.
 The only clause that could potentially require action from you is
that if you *modify* matplotlib and want to distribute it for others,
you need to summarize the changes you made (clause 3).
If you end up making a lot of money, remember us on the "donations" page :-)
http://sourceforge.net/project/project_donations.php?group_id=80706
JDH
9 messages has been excluded from this view by a project administrator.

Showing results of 303

<< < 1 .. 6 7 8 9 10 .. 13 > >> (Page 8 of 13)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /