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


Showing 9 results of 9

From: Angel Yanguas-G. <ang...@gm...> - 2011年06月05日 23:12:38
Hi, I am running matplotlib 1.0.0 on python 2.7.1 (r271:86882M, Nov 30
2010, 09:39:13) in snow leopard from python.org and I have come across
a problem saving pdf files.
Trying the simple script:
import matplotlib.pyplot as pt
pt.plot([1, 2, 3])
pt.savefig("figure.pdf")
Causes a bus error and a python crash.
There is a previous thread in the list that suggests that the problem
is not matplotlib related. However, that thread refers to EPD, which
is not my case. The apparent solution in that thread was deleting
DYLD_LIBRARY_PATH from .profile (don't understand why), but I don't
have such environment variable defined.
Has anyone come across anything like that?
Many thanks!
Angel
From: thecommexokid <the...@gm...> - 2011年06月05日 23:01:16
Hi all,
I am new to the forum and to all things PyGTK and matplotlib, so go easy on
me, please.
A colleague created a Python program that uses matplotlib and GTK. I wanted
to be able run her program on my MacBook (OS X 10.6.7). I used macports to
update/obtain Python 2.7, matplotlib 1.0.1, and PyGTK 2.22.0. (I also
obtained ipython, if anyone cares.)
After all of this, my colleague's program hits a snag when I try to run it;
here is the traceback:
Traceback (most recent call last):
&nbsp;&nbsp;File "main.py", line 5, in 
&nbsp;&nbsp;&nbsp;&nbsp;from interface import Interface, Display, Controls
&nbsp;&nbsp;File
"/Users/thecommexokid/Documents/CurrentProjects/Honors/DoubleSlit/interface.py",
line 5, in &lt;module&gt;
&nbsp;&nbsp;&nbsp;&nbsp;from matplotlib.backends.backend_gtkagg import
FigureCanvasGTKAgg
&nbsp;&nbsp;File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py",
line 10, in &lt;module&gt;
&nbsp;&nbsp;&nbsp;&nbsp;from matplotlib.backends.backend_gtk import gtk,
FigureManagerGTK, FigureCanvasGTK,\
&nbsp;&nbsp;File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py",
line 28, in &lt;module&gt;
&nbsp;&nbsp;&nbsp;&nbsp;from matplotlib.backends.backend_gdk import
RendererGDK, FigureCanvasGDK
&nbsp;&nbsp;File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_gdk.py",
line 29, in &lt;module&gt;
&nbsp;&nbsp;&nbsp;&nbsp;from matplotlib.backends._backend_gdk import
pixbuf_get_pixels_array
ImportError: No module named _backend_gdk
I believe I may be having the same problem as the user in 
http://old.nabble.com/_backend_gdk-not-found-td26514059.html#a26514059 this
post , but I am enough of a novice that the solution that was suggested
there just sounds like gobbletygook to me. If anybody wants to elaborate on
that so I can try it out, please do.
Anyhow, any advice anyone has on how to overcome this problem and get her
program running on my machine would be greatly appreciated. As I said, I am
new to these things, and I don't really understand the interplay between
Python, PyGTK, and matplotlib, so if there's crucial information I haven't
provided, or if this isn't the best forum in which to be asking this
question, let me know.
Thanks in advance for the help.
***
PS: I originally posted this question at the GTK+ Forums (
http://www.gtkforums.com/viewtopic.php?f=3&p=69969#p69969 thread ), but it
seemed as though this might be the more appropriate forum. I'll be sure to
keep both threads updated with any developments.
-- 
View this message in context: http://old.nabble.com/ImportError-when-I-import-FigureCanvasGTKAgg%E2%80%94seeking-advice%21-tp31779648p31779648.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John J. <jw...@gm...> - 2011年06月05日 21:47:43
OK, I just found the fix ­ within two minutes of my last email to you (after
spending 6 hours on it)!!
I needed to use the following variant for the macports installation (like I
said, I rather new at the Mac and unix):
sudo port install py26-matplotlib @1.0.1 +gtk2
for the matplotlib installation. it works now, although I still get this
message:
Xlib: extension "RANDR" missing on display "/tmp/launch-KDlxaE/org.x:0".
thanks,
john
From: Carlos G. <car...@gm...> - 2011年06月05日 21:38:45
Hi all,
I'm developing an app for structural geology called OenStereo (
www.igc.usp.br/openstereo), using matplotlib and wxpython.
So far, I'm really happy with the results, but there is still one thing
annoying me: when I save the plots (using the save icon in the
NavigationToolbar),
the resulting figure size is determined by the size of the window. Can I set
this to a fixed value (like 15cm)?
this is a part of the code where I create the figure:
#initialize the figure and canvas
 self.stereoFigure = Figure(figsize=(4,4),facecolor='white')
 self.stereoCanvas = FigureCanvas(self, -1, self.stereoFigure)
 self.toolbar = VMToolbar(self.stereoCanvas)
 self.stereoCanvas.mpl_connect("motion_notify_event", self.OnMove)
#initialize the plot area
 self.plotaxes = self.stereoFigure.add_axes([0.01, 0.01, 0.6, 0.98],
clip_on='True',xlim=(-1.1,1.2), ylim=(-1.15,1.15),
adjustable='box',autoscale_on='False',label='stereo')
 self.plotaxes.set_axis_off()
 self.plotaxes.set_aspect(aspect='equal', adjustable=None,
anchor='W')
best
Carlos
-- 
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
http://lattes.cnpq.br/5846052449613692
Linux User #89721
________________
Can’t stop the signal.
From: John J. <jw...@gm...> - 2011年06月05日 21:38:41
I am having the old "no gdk backend" problem with GTKAgg. I am running OS X
10.6 (Snow Leopard), and, uh, I'm kind of new to Unix :). I installed the
following through Macports:
python26 @2.6.6_3 (active)
py26-gtk @2.22.0_1 (active)
py26-matplotlib @1.0.1_3+tkinter (active)
py26-numpy @1.6.0_0+atlas+gcc44 (active)
and the following code:
> 
> from numpy import *
> import gtk
> import gobject
> import matplotlib
> matplotlib.use('GTKAgg')
> import matplotlib.pyplot as plt
> 
gives the following error on the pyplot import:
> 
> pydev debugger: warning: psyco not available for speedups (the debugger will
> still work correctly, but a bit slower)
> 
> pydev debugger: starting
> 
> Xlib: extension "RANDR" missing on display "/tmp/launch-KDlxaE/org.x:0".
> 
> Traceback (most recent call last):
> 
> File 
> "/Applications/eclipseJavaHelios/plugins/org.python.pydev.debug_2.0.0.20110404
> 03/pysrc/pydevd.py", line 1134, in <module>
> 
> debugger.run(setup['file'], None, None)
> 
> File 
> "/Applications/eclipseJavaHelios/plugins/org.python.pydev.debug_2.0.0.20110404
> 03/pysrc/pydevd.py", line 918, in run
> 
> pydev_imports.execfile(file, globals, locals) #execute the script
> 
> File 
> "/Users/jwjameson/Dropbox/mine/PyStuff/workspace/Continuous/Pothead/Animator_P
> H_MPL.py", line 20, in <module>
> 
> import matplotlib.pyplot as plt
> 
> File 
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit
> e-packages/matplotlib/pyplot.py", line 95, in <module>
> 
> new_figure_manager, draw_if_interactive, show = pylab_setup()
> 
> File 
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit
> e-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
> 
> globals(),locals(),[backend_name])
> 
> File 
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit
> e-packages/matplotlib/backends/backend_gtkagg.py", line 10, in <module>
> 
> from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK,
> FigureCanvasGTK,\
> 
> File 
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit
> e-packages/matplotlib/backends/backend_gtk.py", line 28, in <module>
> 
> from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
> 
> File 
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit
> e-packages/matplotlib/backends/backend_gdk.py", line 29, in <module>
> 
> from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
> 
> ImportError: No module named _backend_gdk
I noticed the page:
http://matplotlib.sourceforge.net/faq/installing_faq.html
<http://matplotlib.sourceforge.net/faq/installing_faq.html>
says nothing about Macports.
I noticed the page 
http://old.nabble.com/_backend_gdk-not-found-td26514059.html
<http://old.nabble.com/_backend_gdk-not-found-td26514059.html>
where Mr. Hunter says:
> matplotlib is probably not finding pygtk at build time -- you need
> have pkg-config installed, and locate your pygtk-2.0.pc file and then
> add that path to your PKG_CONFIG_PATH. You can check the output of
> the build script at the beginning in the section
> 
> OPTIONAL BACKEND DEPENDENCIES
> libpng: 1.2.27
> Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
> wxPython: 2.8.8.0
> * WxAgg extension not required for wxPython >= 2.8
> Gtk+: gtk+: 2.14.4, glib: 2.18.2, pygtk: 2.13.0,
> pygobject: 2.15.3
> Mac OS X native: no
> Qt: Qt: 3.3.8, PyQt: 3.17.4
> Qt4: Qt: 4.4.3, PyQt4: 4.4.4
> Cairo: 1.4.12
> 
> You need to have an entry for Gtk or else the backend will not be built.
> 
but I have no idea how to utilize this info with Macports. I was not able to
locate a pygtk-2.0.pc file. If there were such a file, would Macports look
at it to configure the matplotlib installation as I would like (to be able
to use the GTKAgg backend)?
Any suggestions are greatly appreciated!
best,
john
From: Daπid <dav...@gm...> - 2011年06月05日 11:16:10
I am using MPL 1.0.1 with Python 2.6 over Windows XP and it works.
I would like to add an advice: range(n) creates a list of size n, and
stores it in memory. But in your code you are only using one number at
a time. Python has a better instruction: xrange. It works exactly like
range, but doesn't create the list; it will return sequentially every
number without the need of storing all at once.
In this simple program it makes no difference, but when you go bigger, it will.
David.
On Sun, Jun 5, 2011 at 3:28 AM, Joe Kington <jki...@wi...> wrote:
> Your code should work (and does on my system)...
> What backend, version of matplotlib, OS, etc are you running?
>
> On Sat, Jun 4, 2011 at 4:54 PM, Armin G <ar...@gm...> wrote:
>>
>> Hi everyone ,
>>
>> I know this has been posted several times now, But I could not understand
>> qietly why my simple code does not work.
>> here is the code:
>> http://old.nabble.com/file/p31775254/LinearConvection.py
>> LinearConvection.py
>>
>> The problem in detail: In the solver loop ( the outer loop) , The plot
>> should be updated after every time step, but it stays the same.
>>
>> I'm a complete noob in python, so excuse my simple communicating language.
>>
>> thanks alot,
>> Armin
>> --
>> View this message in context:
>> http://old.nabble.com/Plotting-in-loop-problem%2C-not-refreshing-tp31775254p31775254.html
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Simplify data backup and recovery for your virtual environment with
>> vRanger.
>> Installation's a snap, and flexible recovery options mean your data is
>> safe,
>> secure and there when you need it. Discover what all the cheering's about.
>> Get your free trial download today.
>> http://p.sf.net/sfu/quest-dev2dev2
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with vRanger.
> Installation's a snap, and flexible recovery options mean your data is safe,
> secure and there when you need it. Discover what all the cheering's about.
> Get your free trial download today.
> http://p.sf.net/sfu/quest-dev2dev2
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Eric F. <ef...@ha...> - 2011年06月05日 01:53:37
https://github.com/efiring/matplotlib/blob/faq_show_draw/doc/faq/usage_faq.rst
Eric, Ben,
See if the section "What is interactive mode" makes sense to you. I 
have just added it to a feature branch (which includes some other faq 
madifications, mainly moving the backend section from installation to 
usage), but have not yet generated a pull request. It doesn't go into 
every detail, or into the underlying machinery. It is intended to 
provide just enough understanding to clear up user-level confusion about 
interactive mode, show, and draw, and let most relatively new users get 
on with their work.
Eric
From: Joe K. <jki...@wi...> - 2011年06月05日 01:28:14
Your code should work (and does on my system)...
What backend, version of matplotlib, OS, etc are you running?
On Sat, Jun 4, 2011 at 4:54 PM, Armin G <ar...@gm...> wrote:
>
> Hi everyone ,
>
> I know this has been posted several times now, But I could not understand
> qietly why my simple code does not work.
> here is the code:
> http://old.nabble.com/file/p31775254/LinearConvection.pyLinearConvection.py
>
> The problem in detail: In the solver loop ( the outer loop) , The plot
> should be updated after every time step, but it stays the same.
>
> I'm a complete noob in python, so excuse my simple communicating language.
>
> thanks alot,
> Armin
> --
> View this message in context:
> http://old.nabble.com/Plotting-in-loop-problem%2C-not-refreshing-tp31775254p31775254.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with
> vRanger.
> Installation's a snap, and flexible recovery options mean your data is
> safe,
> secure and there when you need it. Discover what all the cheering's about.
> Get your free trial download today.
> http://p.sf.net/sfu/quest-dev2dev2
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Armin G <ar...@gm...> - 2011年06月05日 00:54:34
Hi everyone ,
I know this has been posted several times now, But I could not understand
qietly why my simple code does not work. 
here is the code:
http://old.nabble.com/file/p31775254/LinearConvection.py LinearConvection.py 
The problem in detail: In the solver loop ( the outer loop) , The plot
should be updated after every time step, but it stays the same.
I'm a complete noob in python, so excuse my simple communicating language.
thanks alot,
Armin
-- 
View this message in context: http://old.nabble.com/Plotting-in-loop-problem%2C-not-refreshing-tp31775254p31775254.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Showing 9 results of 9

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 によって変換されたページ (->オリジナル) /