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





Showing 12 results of 12

From: Sterling S. <sm...@fu...> - 2011年10月17日 23:00:35
Let me first say that I appreciate the work that the developers have put into matplotlib. You're doing a great job. 
I have filed a bug report at 
https://github.com/matplotlib/matplotlib/issues/533
wherein I post the following
Consider:
from pylab import *
x = arange(0,1,.01)
y = x**2
fig = figure(2)
ax = fig.add_subplot(111)
errorbar(x,y,yerr=x/10.,label='$x^2$')
errorbar(x,y**3,yerr=x/10.,label='$x^6$')
legend(loc='upper center')
h,l = ax.get_legend_handles_labels()
fig.legend(h,l,loc='lower right')
I am getting the right legend for the axes based legend, but the figure based legend seems to be using the different parts of the errorbar for subsequent handles, instead of using them as a group. From what I can tell, this has appeared since the upgrade to version 1.1.0.
I am running on Linux, python 2.7, gtkAgg backend.
Thanks,
Sterling
From: Rich S. <rsh...@ap...> - 2011年10月17日 23:00:02
On 2011年10月17日, Benjamin Root wrote:
> I only need the last line printed by that print statement. I want to see
> how the parsing failed.
Ben,
 Here are the last 3:
Line: C 125 ; WX 273 ; N braceright ; B 55 -68 244 707 ;
Line: C 126 ; WX 586 ; N asciitilde ; B 39 219 531 408 ;
Line: C 127 ; WX 262 ; N ; B 64 506 246 730 ;
 I see there's no character in the last line. Isn't that interesting!
Rich
From: Benjamin R. <ben...@ou...> - 2011年10月17日 22:34:09
On Monday, October 17, 2011, Rich Shepard <rsh...@ap...> wrote:
> On 2011年10月17日, Benjamin Root wrote:
>
>> On line 166, I want you to put "print 'Line:', line". Then, rerun your
>> program and report back what the output of that print statement.
>
> Ben,
>
> Sorry I mis-understood your request.
>
> I redirected the output to a file 'error.log' and it contains 104,777
> lines from the 'print line' command. I can gzip it and send it to you off
> the list but it's 5.5M in size.
>
> When I grep for Underline in error.log it's not found. That seems to be
> the unknown keyword.
>
> How would you like me to proceed?
>
> Thanks,
>
> Rich
>
I only need the last line printed by that print statement. I want to see
how the parsing failed.
Ben
From: Rich S. <rsh...@ap...> - 2011年10月17日 20:27:34
On 2011年10月17日, Benjamin Root wrote:
> On line 166, I want you to put "print 'Line:', line". Then, rerun your
> program and report back what the output of that print statement.
Ben,
 Sorry I mis-understood your request.
 I redirected the output to a file 'error.log' and it contains 104,777
lines from the 'print line' command. I can gzip it and send it to you off
the list but it's 5.5M in size.
 When I grep for Underline in error.log it's not found. That seems to be
the unknown keyword.
 How would you like me to proceed?
Thanks,
Rich
From: tinux <hof...@gm...> - 2011年10月17日 19:57:28
I have around 100 python files, that each create one figure using matplotlib.
Since I want to use all CPU cores, I basically did "for filename in files:
execfile(filename)" using a python script. However, this does not produce
the same output as running each file separately (for instance axes, figure
size are sometime wrong).
I _think_ I narrowed it down to this: In all files I need to do
"matplotlib.rcParams(update)". I guess that this influences the matplotlib
rc parameters and thus somehow values from some figures are used for others. 
So, my question is, how can I do something like
"matplotlib.rcParams(update)" so that it does not influence other scripts
that are run in parallel using 'execfile'? Or, how do I set rc parameters
for one specific script?
BTW, I tried 'pp' and 'multiprocessing', same problem with both.
Any help is greatly appreciated!
Cheers, Martin
-- 
View this message in context: http://old.nabble.com/matplotlib.rcParams%28update%29-and-parallel-python-tp32669484p32669484.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2011年10月17日 18:27:29
On Monday, October 17, 2011, Rich Shepard <rsh...@ap...> wrote:
> On 2011年10月17日, Benjamin Root wrote:
>
>> In the afm.py file, a before line 167, can you print the value of the
>> "line" variable and tell us what it is?
>
> Ben,
>
> Here are lines 158-167:
>
> while 1:
> line = fh.readline()
> if not line: break
> line = line.rstrip()
> if line.startswith('EndCharMetrics'): return ascii_d, name_d
> vals = line.split(';')[:4]
> if len(vals) !=4 : raise RuntimeError('Bad char metrics line: %s'
> num = _to_int(vals[0].split()[1])
> wx = _to_float(vals[1].split()[1])
> name = vals[2].split()[1]
>
> Thanks,
>
> Rich
>
Rich,
On line 166, I want you to put "print 'Line:', line". Then, rerun your
program and report back what the output of that print statement.
Ben Root
From: Rich S. <rsh...@ap...> - 2011年10月17日 18:19:16
On 2011年10月17日, Benjamin Root wrote:
> In the afm.py file, a before line 167, can you print the value of the
> "line" variable and tell us what it is?
Ben,
 Here are lines 158-167:
 while 1:
 line = fh.readline()
 if not line: break
 line = line.rstrip()
 if line.startswith('EndCharMetrics'): return ascii_d, name_d
 vals = line.split(';')[:4]
 if len(vals) !=4 : raise RuntimeError('Bad char metrics line: %s'
 num = _to_int(vals[0].split()[1])
 wx = _to_float(vals[1].split()[1])
 name = vals[2].split()[1]
Thanks,
Rich
From: Benjamin R. <ben...@ou...> - 2011年10月17日 18:13:12
On Mon, Oct 17, 2011 at 12:57 PM, Rich Shepard <rsh...@ap...>wrote:
> After a long hiatus I'm again working on an application and just upgraded
> matplotlib from 0.98.5.2 to 0.99.1.2. However, there's an error on start up
> that I need your help in resolving.
>
> There are many dozens of lines containing:
>
> Found an unknown keyword in AFM header (was Underline)
>
> The traceback (in its entirety) shows:
>
> Traceback (most recent call last):
> File "./eikos.py", line 6, in <module>
> from modelPage import modModel
> File "/home/rshepard/development/trunk/modelPage.py", line 8, in <module>
> from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as
> FigureCanvas
> File
> "/usr/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py",
> line 20, in <module>
> from matplotlib.figure import Figure
> File "/usr/lib/python2.6/site-packages/matplotlib/figure.py", line 18, in
> <module>
> from axes import Axes, SubplotBase, subplot_class_factory
> File "/usr/lib/python2.6/site-packages/matplotlib/axes.py", line 12, in
> <module>
> import matplotlib.axis as maxis
> File "/usr/lib/python2.6/site-packages/matplotlib/axis.py", line 10, in
> <module>
> import matplotlib.font_manager as font_manager
> File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
> 1301, in <module>
> _rebuild()
> File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
> 1292, in _rebuild
> fontManager = FontManager()
> File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
> 1010, in __init__
> self.afmlist = createFontList(self.afmfiles, fontext='afm')
> File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
> 578, in createFontList
> font = afm.AFM(fh)
> File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 295, in
> __init__
> parse_afm(fh)
> File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 283, in
> parse_afm
> dcmetrics_ascii, dcmetrics_name = _parse_char_metrics(fh)
> File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 167, in
> _parse_char_metrics
> name = vals[2].split()[1]
> IndexError: list index out of range
>
> Please tell me what I need to do to resolve this error.
>
> Rich
>
>
Rich,
In the afm.py file, a before line 167, can you print the value of the "line"
variable and tell us what it is?
Ben Root
From: Rich S. <rsh...@ap...> - 2011年10月17日 17:58:00
 After a long hiatus I'm again working on an application and just upgraded
matplotlib from 0.98.5.2 to 0.99.1.2. However, there's an error on start up
that I need your help in resolving.
 There are many dozens of lines containing:
Found an unknown keyword in AFM header (was Underline)
The traceback (in its entirety) shows:
Traceback (most recent call last):
 File "./eikos.py", line 6, in <module>
 from modelPage import modModel
 File "/home/rshepard/development/trunk/modelPage.py", line 8, in <module>
 from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as
FigureCanvas
 File
"/usr/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py",
line 20, in <module>
 from matplotlib.figure import Figure
 File "/usr/lib/python2.6/site-packages/matplotlib/figure.py", line 18, in
<module>
 from axes import Axes, SubplotBase, subplot_class_factory
 File "/usr/lib/python2.6/site-packages/matplotlib/axes.py", line 12, in
<module>
 import matplotlib.axis as maxis
 File "/usr/lib/python2.6/site-packages/matplotlib/axis.py", line 10, in
<module>
 import matplotlib.font_manager as font_manager
 File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
1301, in <module>
 _rebuild()
 File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
1292, in _rebuild
 fontManager = FontManager()
 File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line 
1010, in __init__
 self.afmlist = createFontList(self.afmfiles, fontext='afm')
 File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
578, in createFontList
 font = afm.AFM(fh)
 File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 295, in
__init__
 parse_afm(fh)
 File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 283, in
parse_afm
 dcmetrics_ascii, dcmetrics_name = _parse_char_metrics(fh)
 File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 167, in
_parse_char_metrics
 name = vals[2].split()[1]
IndexError: list index out of range
 Please tell me what I need to do to resolve this error.
Rich
From: Piter_ <x....@gm...> - 2011年10月17日 17:02:49
Hi all
I want to draw an two headed arrow between two points.
But I get a line. What I am doing wrong? I actually try to plot an
image similar to this one:
http://upload.wikimedia.org/wikipedia/commons/a/a3/Parameters_of_the_Marcus_Equation.JPG
may be I can use an annotate function for this.
Thanks for help.
Petro.
########
import pylab
from scipy import optimize
import numpy
x1=numpy.arange(-4000,1000,0.1)
x2=numpy.arange(-1000,4000,0.1)
y1=100*numpy.square(x1+1500)
y2=100*numpy.square(x2-1500)-0.1e9
pylab.figure()
pylab.plot(x1,y1,x2,y2)
pylab.grid("True")
pylab.arrow(-3000,0,0,-100000000,width=1)
pylab.xlim(-5000,5000)
pylab.ylim(-2e8,7e8)
pylab.show()
###########x
From: C M <cmp...@gm...> - 2011年10月17日 03:51:08
> So, it seems that the issue is platform-dependent.
OK.
> As for the error message, it seems that the subplot_params values
> (left, right, top, bottom, etc) calculated by the "tight_layout"
> routine is somehow corrupted.
> Why this happens is hard to track down unless I can reproduce the error.
> And I hope any other windows developer out there can take a look at this issue.
>
> Meanwhile, can you play a little bit more with your script?
>
> 1) check the size of the figure (print self.figure.get_size_inches())
> before a tight_layout is called.
What it prints is this:
[ 8. 6.]
> 2) see if calling the draw method (self.canvas.draw()) before the
> tight_layout helps.
It didn't help.
> Also, please open a git issue on this so that others can take a look.
Sure. It's issue #532. (I tried to include the sample script but the
indenting got removed from the issue window, not sure how to fix
that).
Thanks,
Che
From: Jae-Joon L. <lee...@gm...> - 2011年10月17日 01:14:17
On Mon, Oct 17, 2011 at 1:03 AM, C M <cmp...@gm...> wrote:
> - Error if I call self.panel.Layout() before I call tight_layout().
In my system, I don't see any error whether ` self.panel.Layout() is in or not.
> - If I don't do this, no error, but it still isn't doing a proper tight layout.
>
Your script DOES work in my system (but I'm using it with wxGTK) and
it DOES a proper tight_layout.
(However, the figure size never gets smaller than the original figure
size so it shows only the part of the figure when the window is
smaller than the original figure size).
So, it seems that the issue is platform-dependent.
As for the error message, it seems that the subplot_params values
(left, right, top, bottom, etc) calculated by the "tight_layout"
routine is somehow corrupted.
Why this happens is hard to track down unless I can reproduce the error.
And I hope any other windows developer out there can take a look at this issue.
Meanwhile, can you play a little bit more with your script?
1) check the size of the figure (print self.figure.get_size_inches())
before a tight_layout is called.
2) see if calling the draw method (self.canvas.draw()) before the
tight_layout helps.
Also, please open a git issue on this so that others can take a look.
Regards,
-JJ

Showing 12 results of 12

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