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
(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)



Showing 9 results of 9

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
From: Nils W. <nw...@ia...> - 2012年02月20日 15:32:34
Attachments: image.png
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
From: Eric F. <ef...@ha...> - 2012年02月20日 06:19:24
On 02/19/2012 07:46 PM, Khary Richardson wrote:
> Hi Eric,
>
> Ok I guess I have a bigger problem. The plot window opens,but nothing
> is plotted. I thought that the blank window was because the code was
> hanging and not plotting. I had it work once and plot, but now I just
> get the blank window.
Khary,
(Please keep correspondence on the list so others can jump in, and 
whatever answer emerges is available to others.)
You need to provide more information: operating system, mpl version, 
backend, how you installed it.
Some systematic troubleshooting is also in order. Start here: 
http://matplotlib.sourceforge.net/faq/index.html.
Eric
>
> Khary
>
> On Mon, Feb 20, 2012 at 12:25 AM, Eric Firing <ef...@ha...
> <mailto:ef...@ha...>> wrote:
>
> On 02/19/2012 07:08 PM, surfcast23 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
>
> That's what show() does in a script--it displays the plot and blocks
> execution until you close the window. It can be more complicated than
> that depending on the version of mpl you are running. So, what version
> are you running, and what is the behavior you are trying to achieve? An
> animation?
>
> Eric
>
> >
> > from numpy import *
> > import matplotlib.pyplot as plt
> >
> > #H=p^2/2-cosq
> > #p=dp=-dH/dq
> > #q=dq=dH/dp
> >
> > t = 0
> > h = 0.5
> > pfa = [] #Create arrays that will hold
> pf,qf values
> > qfa = []
> >
> > while t< 10:
> > q = 1+t
> > p = -sin(q+t)
> >
> > p1 = p
> > q1 = q
> > p2 = p + h/2*q1
> > q2 = q + h/2*p1
> > p3 = p+ h/2*q2
> > q3 = q+ h/2*p2
> > p4 = p+ h/2*q3
> > q4 = q+ h/2*p4
> > pf = (p +(h/6)*(p1+2*p2+3*p3+p4))
> > qf = (q +(h/6)*(q1+2*q2+3*q3+q4))
> > #pf = log10(pf) #Convert to log scale
> > #qf = log10(qf)
> > pfa.append(pf) #append arrays
> > qfa.append(qf)
> > t += h #increase time step
> >
> > print("test")
> > plt.plot(pfa,qfa)
> > print("test1")
> > plt.show()
> > print("tes2t")
> >
> >
> >
> >
>
>
> ------------------------------------------------------------------------------
> 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...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> --
> StriperCoast SurfCasters Club
>
From: Eric F. <ef...@ha...> - 2012年02月20日 05:25:51
On 02/19/2012 07:08 PM, surfcast23 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
That's what show() does in a script--it displays the plot and blocks 
execution until you close the window. It can be more complicated than 
that depending on the version of mpl you are running. So, what version 
are you running, and what is the behavior you are trying to achieve? An 
animation?
Eric
>
> from numpy import *
> import matplotlib.pyplot as plt
>
> #H=p^2/2-cosq
> #p=dp=-dH/dq
> #q=dq=dH/dp
>
> t = 0
> h = 0.5
> pfa = [] #Create arrays that will hold pf,qf values
> qfa = []
>
> while t< 10:
> q = 1+t
> p = -sin(q+t)
>
> p1 = p
> q1 = q
> p2 = p + h/2*q1
> q2 = q + h/2*p1
> p3 = p+ h/2*q2
> q3 = q+ h/2*p2
> p4 = p+ h/2*q3
> q4 = q+ h/2*p4
> pf = (p +(h/6)*(p1+2*p2+3*p3+p4))
> qf = (q +(h/6)*(q1+2*q2+3*q3+q4))
> #pf = log10(pf) #Convert to log scale
> #qf = log10(qf)
> pfa.append(pf) #append arrays
> qfa.append(qf)
> t += h #increase time step
>
> print("test")
> plt.plot(pfa,qfa)
> print("test1")
> plt.show()
> print("tes2t")
>
>
>
>
From: surfcast23 <sur...@gm...> - 2012年02月20日 05:08:42
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
from numpy import *
import matplotlib.pyplot as plt
#H=p^2/2-cosq
#p=dp=-dH/dq
#q=dq=dH/dp
t = 0
h = 0.5
pfa = [] #Create arrays that will hold pf,qf values
qfa = []
while t < 10:
 q = 1+t
 p = -sin(q+t)
 p1 = p
 q1 = q
 p2 = p + h/2*q1
 q2 = q + h/2*p1
 p3 = p+ h/2*q2
 q3 = q+ h/2*p2
 p4 = p+ h/2*q3
 q4 = q+ h/2*p4
 pf = (p +(h/6)*(p1+2*p2+3*p3+p4))
 qf = (q +(h/6)*(q1+2*q2+3*q3+q4))
 #pf = log10(pf) #Convert to log scale
 #qf = log10(qf)
 pfa.append(pf) #append arrays
 qfa.append(qf)
 t += h #increase time step 
 
 print("test")
 plt.plot(pfa,qfa)
 print("test1")
 plt.show()
 print("tes2t")
 
 
-- 
View this message in context: http://old.nabble.com/Script-hanging-during-plot-of-Runge-Kutta-tp33354840p33354840.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
1 message has been excluded from this view by a project administrator.

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