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




Showing results of 394

1 2 3 .. 16 > >> (Page 1 of 16)
From: empty83 <mat...@gm...> - 2009年03月31日 23:06:55
i can't make a legend for a fill_between and don't understand what i'm doing
wrong. the following code seems like the most obvious way to make a legend
for a fill_between, but does do what i expect. the code plots, but
complains that "No labeled objects found." any help would be much
appreciated.
from pylab import fill_between, legend, show
a = [0,1,2,4,5]
b = [1,1,1,1,1]
c = [0,1,2,4,5]
fill_between(a,b,c,label='hi')
legend()
show() 
-- 
View this message in context: http://www.nabble.com/legends-with-fill_between-tp22816609p22816609.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Thomas R. <tho...@gm...> - 2009年03月31日 20:52:46
The problem with pcolor is that it draws all the pixels as polygons, 
which is very inefficient in terms of file size. For example,
import matplotlib
matplotlib.use('PS')
from matplotlib.pyplot import *
import numpy as np
image = np.random.random((100,100))
fig = figure(figsize=(4,4))
ax = fig.add_subplot(111)
ax.pcolor(image)
fig.savefig('plot.ps')
produces a 2Mb+ file.
Thanks,
Thomas
On Mar 31, 2009, at 4:32 PM, John Hunter wrote:
> On Tue, Mar 31, 2009 at 2:56 PM, Thomas Robitaille
> <tho...@gm...> wrote:
>> Hello,
>>
>> I am using matplotlib to create postscript and SVG files. I am
>> currently using imshow to show the contents of an array, but this
>> means that when saving vector graphics files, matplotlib resamples 
>> the
>> image/array onto a finer grid. What I would like, is for code such as
>> this:
>
>
> I believe pcolor will be closer to what you are looking for.7
>
> JDH
From: John H. <jd...@gm...> - 2009年03月31日 20:32:38
On Tue, Mar 31, 2009 at 2:56 PM, Thomas Robitaille
<tho...@gm...> wrote:
> Hello,
>
> I am using matplotlib to create postscript and SVG files. I am
> currently using imshow to show the contents of an array, but this
> means that when saving vector graphics files, matplotlib resamples the
> image/array onto a finer grid. What I would like, is for code such as
> this:
I believe pcolor will be closer to what you are looking for.7
JDH
From: Thomas R. <tho...@gm...> - 2009年03月31日 19:56:43
Hello,
I am using matplotlib to create postscript and SVG files. I am 
currently using imshow to show the contents of an array, but this 
means that when saving vector graphics files, matplotlib resamples the 
image/array onto a finer grid. What I would like, is for code such as 
this:
import matplotlib
matplotlib.use('PS')
from matplotlib.pyplot import *
import numpy as np
image = np.random.random((10,10))
fig = figure(figsize=(4,4))
ax = fig.add_subplot(111)
ax.imshow(image)
fig.savefig('example1.ps')
fig = figure(figsize=(8,8))
ax = fig.add_subplot(111)
ax.imshow(image)
fig.savefig('example2.ps')
to produce files that are the roughly the same size, rather than 
different by a factor of 4. In addition, both files should be very 
small since they should only contain a 10x10 bitmap in addition to the 
axes+labels. Postscript and SVG (as languages) both allow a bitmap of 
an arbitrary resolution to be scaled, translated, and rotated without 
resampling.
I have come across the figimage method which is meant to place an 
array in a plot without resampling, but I cannot figure out how to use 
it like imshow, i.e. to show the image inside the axes as before. I've 
also tried the pcolor functions, but it seems like they define each 
pixel as an individual polygon, which is inefficient.
I was wondering if anyone had a solution to this, or if there are 
plans to make matplotlib behave like this in future?
Thanks,
Thomas
From: Eric F. <ef...@ha...> - 2009年03月31日 19:10:34
Troels Kofoed Jacobsen wrote:
> Hi All
> 
> Is it possible to cut out a peace of an axes, as shown in the attached mockup. 
> This could typically be used if you have some important data in the interval 
> [0,6] and some other important data in another interval [30,40] as shown in 
> the figure.
> 
A split axis like that has been requested before, but there is no 
built-in facility for it. You could get this effect with some 
programming by using two Axes objects, sharing the Y-axis, and manually 
making the axis lines, ticks, and labels. Maybe someone has done this 
and will reply with an example.
Eric
> Best Regards
> Troels Kofoed Jaobsen
From: Troels K. J. <tkj...@gm...> - 2009年03月31日 18:34:48
Attachments: mockup.pdf
Hi All
Is it possible to cut out a peace of an axes, as shown in the attached mockup. 
This could typically be used if you have some important data in the interval 
[0,6] and some other important data in another interval [30,40] as shown in 
the figure.
Best Regards
Troels Kofoed Jaobsen
From: David E. S. <si...@la...> - 2009年03月31日 18:18:34
Friends,
Oops! "WXAgg" and "TkAgg" rather than "WXApp" and "TkApp", of 
course. I did say that I was just getting my bearings.
Yours,
David
At 12:13 PM 3/31/2009, David E. Sigeti wrote:
>Dear Mike and Jouni,
>
>Since my post from yesterday, I have discovered that I was using the 
>WXApp backend and that using the TkApp backend fixed the problem.
>
>Thanks for the help and sorry about the naive question. I am almost 
>completely new to Matplotlib and am only now getting my bearings.
>
>That said, I have another question: Are there any important 
>implications to the spurious warnings coming from WXApp? I don't 
>know how functional WXApp is expected to be at this point nor even 
>if this problem really precludes using it. For all I know there 
>might be a simple work-around or there might really be no reason at 
>all to use WXApp rather than TkApp. Any light that you can shed 
>here would be much appreciated.
>
>A couple of further observations:
> * As I pointed out, pyplot.show appears to work fine in spite of 
> the warning message. The resulting plot window, however, shows a 
> number of peculiarities in behavior and seems to be missing 
> functionality that the corresponding TkApp window has. All this 
> suggests to me that the WXApp backend may not really be fully 
> functional yet. Any observations or comments?
> * wxPython itself seems to work fine. At least, that is what I 
> see from running the demos.
>Again, thanks for the help and any further comments, observations, 
>advice will be much appreciated.
>
>Yours,
>David
>
>At 08:41 AM 3/31/2009, Michael Droettboom wrote:
>>Which backend are you using? I suspect this is actually a bug in 
>>the GUI framework being used, which we could rule out by running a 
>>simple script to do something basic (like show a window) and see if 
>>we get the same warning.
>>
>>Mike
>>
>>sigeti wrote:
>>>Dear Matplotlib Folks,
>>>
>>>When I run pylab.plot, I get a weird warning:
>>>
>>>** (python:20754): WARNING **: Couldn't connect to system bus
>>>
>>>** (python:20754): WARNING **: Couldn't connect to system bus
>>><matplotlib.lines.Line2D object at 0x1225850>
>>>
>>>(Note that this was copied by hand because the system on which I run
>>>Matplotlib is currently unable to connect to the global internet.)
>>>
>>>The first line really is repeated.
>>>
>>>The number after "python:" changes from one instance of the warning to
>>>another.
>>>
>>>I am running:
>>>
>>>Red Hat Enterprise Linux ES release 4 (Nahant Update 3)
>>>
>>>At least, that is what is in /etc/redhat-release.
>>>
>>>The warning is not fatal and I can display what I attempted to plot with
>>>pylab.show. However, the warning has a significant impact on the
>>>interactive usability of Python and matplotlib as a replacement for Matlab.
>>>
>>>Anyone have any suggestions or observations?
>>>
>>>Yours,
>>>David Sigeti
>>>
>>
>>--
>>Michael Droettboom
>>Science Software Branch
>>Operations and Engineering Division
>>Space Telescope Science Institute
>>Operated by AURA for NASA
>
>---
>Dr. David E. Sigeti
>Phone: 505-667-9239
>E-mail: si...@la...
>Surface mail: MS-F644, Los Alamos National Laboratory,
> Los Alamos, NM 87545 USA
---
Dr. David E. Sigeti
Phone: 505-667-9239
E-mail: si...@la...
Surface mail: MS-F644, Los Alamos National Laboratory,
 Los Alamos, NM 87545 USA
From: David E. S. <si...@la...> - 2009年03月31日 18:13:49
Dear Mike and Jouni,
Since my post from yesterday, I have discovered that I was using the 
WXApp backend and that using the TkApp backend fixed the problem.
Thanks for the help and sorry about the naive question. I am almost 
completely new to Matplotlib and am only now getting my bearings.
That said, I have another question: Are there any important 
implications to the spurious warnings coming from WXApp? I don't 
know how functional WXApp is expected to be at this point nor even if 
this problem really precludes using it. For all I know there might 
be a simple work-around or there might really be no reason at all to 
use WXApp rather than TkApp. Any light that you can shed here would 
be much appreciated.
A couple of further observations:
 * As I pointed out, pyplot.show appears to work fine in spite of 
the warning message. The resulting plot window, however, shows a 
number of peculiarities in behavior and seems to be missing 
functionality that the corresponding TkApp window has. All this 
suggests to me that the WXApp backend may not really be fully 
functional yet. Any observations or comments?
 * wxPython itself seems to work fine. At least, that is what I 
see from running the demos.
Again, thanks for the help and any further comments, observations, 
advice will be much appreciated.
Yours,
David
At 08:41 AM 3/31/2009, Michael Droettboom wrote:
>Which backend are you using? I suspect this is actually a bug in the 
>GUI framework being used, which we could rule out by running a 
>simple script to do something basic (like show a window) and see if 
>we get the same warning.
>
>Mike
>
>sigeti wrote:
>>Dear Matplotlib Folks,
>>
>>When I run pylab.plot, I get a weird warning:
>>
>>** (python:20754): WARNING **: Couldn't connect to system bus
>>
>>** (python:20754): WARNING **: Couldn't connect to system bus
>><matplotlib.lines.Line2D object at 0x1225850>
>>
>>(Note that this was copied by hand because the system on which I run
>>Matplotlib is currently unable to connect to the global internet.)
>>
>>The first line really is repeated.
>>
>>The number after "python:" changes from one instance of the warning to
>>another.
>>
>>I am running:
>>
>>Red Hat Enterprise Linux ES release 4 (Nahant Update 3)
>>
>>At least, that is what is in /etc/redhat-release.
>>
>>The warning is not fatal and I can display what I attempted to plot with
>>pylab.show. However, the warning has a significant impact on the
>>interactive usability of Python and matplotlib as a replacement for Matlab.
>>
>>Anyone have any suggestions or observations?
>>
>>Yours,
>>David Sigeti
>>
>
>--
>Michael Droettboom
>Science Software Branch
>Operations and Engineering Division
>Space Telescope Science Institute
>Operated by AURA for NASA
---
Dr. David E. Sigeti
Phone: 505-667-9239
E-mail: si...@la...
Surface mail: MS-F644, Los Alamos National Laboratory,
 Los Alamos, NM 87545 USA
From: Jae-Joon L. <lee...@gm...> - 2009年03月31日 16:55:29
Hi,
Unfortunately, the current legend frame work does not support errorbars.
And I don't think implementing this is easy. The thing is that
errorbar creates multiple artists instead of single one.
The best workaround I can think of is to make the legend only with
markers (and lines if you want), without errorbars.
The return value of the errorbar command is a length 3 tuple, where
the first element is a line2d instance for markers (and lines
connecting markers).
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.errorbar
Thus, something like below will work.
 legend([eb1[0],eb2[0]],['0.00001','0.0001'],numpoints=1)
-JJ
On Tue, Mar 31, 2009 at 11:02 AM, Wendell Cropper <wcr...@uf...> wrote:
>
> Hi,
>
> This script will not show the correct symbol in the legend for any errorbar
> plots after the first one. The actual plots do show the correct symbols. I
> am using the Enthought Python distribution 2.52001 for windows. I believe
> that Matplotlib 0.91 is the included version. The code is as follows:
>
>
>
> from pylab import *
>
> x = array([0.01,0.02,0.05,0.1,0.2,0.4,0.75,0.9,0.95,0.975])
>
> y1 = array([97.2136817,57.9900693,20.4359209,9.9532211,4.7415577
> ,2.286651,1.2720068,1.2496886,1.0442417,1.0214786])
>
> y1e = array([21.24583421,13.52118541,0.64572956,0.101292487
> ,0.031985423,0.011020589,0.002536264,1.106704045,0.003217541,0.000809814])
>
> y2 = array([95.5086963,52.6831257,20.5578082,9.9830355,4.7549975
> ,2.2913872,1.272631,1.0931035,1.0457724,1.0231651])
>
> y2e = array([6.369373686,2.21322481,0.27464128,0.085151741,0.034399816
> ,0.009026401,0.002442033,0.001618337,0.001406813,0.001251265])
>
>
> eb1 = errorbar(x,y1,y1e, fmt = 'ro')
> eb2 = errorbar(x,y2,y2e, fmt = 'gs')
>
> legend([eb1,eb2],['0.00001','0.0001'],numpoints=1)
>
> show()
>
>
> Thanks for any suggestions.
>
>
>
> Wendell Cropper
> Associate Professor, Biological Process Modeling
>
> University of Florida
> School of Forest Resources and Conservation
> 214 Newins-Ziegler
> PO Box 110410
> Gainesville, FL 32611-0410
>
> 352-846-0859 phone
> 352-392-1707 fax
>
> wcr...@uf...
> http://www.sfrc.ufl.edu/faculty/cropper/
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jouni K. S. <jk...@ik...> - 2009年03月31日 16:21:14
Michael Droettboom <md...@st...> writes:
> sigeti wrote:
>> Dear Matplotlib Folks,
>>
>> When I run pylab.plot, I get a weird warning:
>>
>> ** (python:20754): WARNING **: Couldn't connect to system bus
>
> Which backend are you using? I suspect this is actually a bug in the GUI 
> framework being used, which we could rule out by running a simple script 
> to do something basic (like show a window) and see if we get the same 
> warning.
FWIW, that same message sometimes gets printed when running Gnome
programs in a non-Gnome environment. So perhaps this is a GTK or GTKAgg
backend thing, and could be resolved simply by switching to e.g. TkAgg.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Cohen-Tanugi J. <co...@lp...> - 2009年03月31日 15:29:01
I did not look at the code, but I thought that the errors were 
automatically recomputed in log scale as delta_Y/Y/log(10)
Johann
Michael Droettboom wrote:
> I have to say I don't really have a lot of experience with error bars 
> on log plots -- but the root cause here is that the lower bound of the 
> error bar goes negative, and as we all know, the log of a negative 
> number is undefined. If you can suggest where the lower bound should 
> be drawn or provide third-party examples, I'm happy to look into this 
> further and resolve this "surprise".
>
> Mike
>
> Cohen-Tanugi Johann wrote:
>> yes exactly....
>> I should have provided a test case, thanks for following up!
>> Johann
>>
>> Matthias Michler wrote:
>> 
>>> Hello Johann,
>>>
>>> is the problem you are reporting the one I observe in the attached 
>>> picture? Namely some vertical and horizontal lines are missing when 
>>> using yscale="log". More precisely everything below y=1 seems to be 
>>> missing.
>>>
>>> The picture was generated with the code below and
>>> matplotlib.__version__ = '0.98.6svn'
>>> matplotlib.__revision__ = '$Revision: 6887 $'
>>>
>>> best regards Matthias
>>>
>>> ###############################
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>>
>>> plt.subplot(111, xscale="log", yscale="log")
>>> x = 10.0**np.linspace(0.0, 2.0, 20)
>>> y = x**2.0
>>> plt.errorbar(x, y, xerr=0.1*x, yerr=5.0+0.75*y)
>>> plt.show()
>>> ################################
>>> On Friday 27 March 2009 16:12:12 Cohen-Tanugi Johann wrote:
>>> 
>>>> Hello, what is the best way to get log log plots with error bars? I
>>>> tried putting log10() everywhere but as I was afraid results look 
>>>> ugly....
>>>> thanks,
>>>> johann
>>>> 
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> ------------------------------------------------------------------------------ 
>>>>
>>>> 
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>> 
>>
>> ------------------------------------------------------------------------------ 
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>
From: Michael D. <md...@st...> - 2009年03月31日 15:22:27
It seems there's some order dependence here. I have changed the Axes 
constructor so the scale is set before the labels, and this seems to 
resolve this bug.
Fixed in SVN r7016
Mike
Matthias Michler wrote:
> Hello list,
>
> in the small example below with xscale and yscale logarithmic I'm not able to 
> set the xlabel inside the axes initialisation. The error output is attached. 
> It doesn't happen if I use the pylab command 'xlabel' or set one of the 
> scalings to linear.
>
> Is this a bug or do I miss anything? 
>
> Thanks in advance for any hints.
>
> regards Matthias
>
> 
>> -------------------------------------------------
>> 
> import matplotlib.pyplot as plt
>
> ax = plt.subplot(111, autoscale_on=False,
> xscale="log", yscale="log",
> xlim=(1, 10**4), ylim=(10**-4, 1),
> xlabel="logx",
> )
> #plt.xlabel('logx')
> plt.show()
> 
>> -------------------------------------------------------
>> 
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------------
>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>> -Strategies to boost innovation and cut costs with open source participation
>> -Receive a 600ドル discount off the registration fee with the source code: SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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: Michael D. <md...@st...> - 2009年03月31日 15:09:35
I have to say I don't really have a lot of experience with error bars on 
log plots -- but the root cause here is that the lower bound of the 
error bar goes negative, and as we all know, the log of a negative 
number is undefined. If you can suggest where the lower bound should be 
drawn or provide third-party examples, I'm happy to look into this 
further and resolve this "surprise".
Mike
Cohen-Tanugi Johann wrote:
> yes exactly....
> I should have provided a test case, thanks for following up!
> Johann
>
> Matthias Michler wrote:
> 
>> Hello Johann,
>>
>> is the problem you are reporting the one I observe in the attached picture? 
>> Namely some vertical and horizontal lines are missing when using 
>> yscale="log". More precisely everything below y=1 seems to be missing.
>>
>> The picture was generated with the code below and
>> matplotlib.__version__ = '0.98.6svn'
>> matplotlib.__revision__ = '$Revision: 6887 $'
>>
>> best regards Matthias
>>
>> ###############################
>> import numpy as np
>> import matplotlib.pyplot as plt
>>
>> plt.subplot(111, xscale="log", yscale="log")
>> x = 10.0**np.linspace(0.0, 2.0, 20)
>> y = x**2.0
>> plt.errorbar(x, y, xerr=0.1*x, yerr=5.0+0.75*y)
>> plt.show()
>> ################################
>> On Friday 27 March 2009 16:12:12 Cohen-Tanugi Johann wrote:
>> 
>> 
>>> Hello, what is the best way to get log log plots with error bars? I
>>> tried putting log10() everywhere but as I was afraid results look ugly....
>>> thanks,
>>> johann
>>> 
>>>
>>> ------------------------------------------------------------------------
>>>
>>> ------------------------------------------------------------------------
>>>
>>> ------------------------------------------------------------------------------
>>> 
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>>> 
>
> ------------------------------------------------------------------------------
> _______________________________________________
> 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: Wendell C. <wcr...@uf...> - 2009年03月31日 15:03:06
Hi,
This script will not show the correct symbol in the legend for any errorbar
plots after the first one. The actual plots do show the correct symbols. I
am using the Enthought Python distribution 2.52001 for windows. I believe
that Matplotlib 0.91 is the included version. The code is as follows:
from pylab import *
x = array([0.01,0.02,0.05,0.1,0.2,0.4,0.75,0.9,0.95,0.975])
y1 = array([97.2136817,57.9900693,20.4359209,9.9532211,4.7415577
,2.286651,1.2720068,1.2496886,1.0442417,1.0214786])
y1e = array([21.24583421,13.52118541,0.64572956,0.101292487
,0.031985423,0.011020589,0.002536264,1.106704045,0.003217541,0.000809814])
y2 = array([95.5086963,52.6831257,20.5578082,9.9830355,4.7549975
,2.2913872,1.272631,1.0931035,1.0457724,1.0231651])
y2e = array([6.369373686,2.21322481,0.27464128,0.085151741,0.034399816
,0.009026401,0.002442033,0.001618337,0.001406813,0.001251265])
eb1 = errorbar(x,y1,y1e, fmt = 'ro')
eb2 = errorbar(x,y2,y2e, fmt = 'gs')
legend([eb1,eb2],['0.00001','0.0001'],numpoints=1)
show()
Thanks for any suggestions.
Wendell Cropper
Associate Professor, Biological Process Modeling
University of Florida
School of Forest Resources and Conservation
214 Newins-Ziegler
PO Box 110410
Gainesville, FL 32611-0410
352-846-0859 phone
352-392-1707 fax
wcr...@uf...
http://www.sfrc.ufl.edu/faculty/cropper/
From: Bala s. <bal...@gm...> - 2009年03月31日 15:01:10
Friends,
1) I want to make a plot of multiple lines. I want to make something like
./multiplot.py 1.dat 2.dat 3.dat ...... n.dat
All files contain two columns and are of same length. plotfile() and load()
do not take list of file but one file name only. In such cases, I want to
unpack the x,y values in 1.dat,2.dat.... n.dat and plot it at a stretch.
What is the best way to do it. Any suggestion would be highly helpful.
2) How can i fix the default values, like first line should be black, second
line in red ...., third in blue.
Thanks
 bala
From: Michael D. <md...@st...> - 2009年03月31日 14:48:25
I am not able to reproduce this with 0.98.3 either, with the two example 
lines you've shown. Perhaps it's an interaction with some other part of 
your script? Can you provide a complete example that duplicates this 
problem? Or are those two lines enough for you?
Mike
Markus Haider wrote:
> Am Freitag, den 27.03.2009, 07:58 -0500 schrieb John Hunter:
> 
>> On Fri, Mar 27, 2009 at 5:00 AM, marcusantonius
>> <mar...@st...> wrote:
>> 
>> Hi,
>> 
>> I have a problem when saving my plot as a png. The horizontal
>> lines, which I
>> inserted via
>> axhline(y=0.136, xmin=0., xmax=1, color='black',ls=':')
>> axhline(y=0.094, xmin=0., xmax=1, color='black',ls=':')
>> are not displayed right in the png file. Saving in pdf works
>> perfectly. I
>> enclosed the two files in this email.
>> http://www.nabble.com/file/p22738740/p25.pdf p25.pdf
>> http://www.nabble.com/file/p22738740/p25.png p25.png
>> 
>> Is there a way to fix this problem?
>>
>>
>> This appears to be working fine for me with svn matplotlib -- what
>> version are you using? See also:
>> http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-problem for information about how to obtain version and other configuration information.
>> 
>> 
>
> I am using 0.98.3-3, which is in the Ubuntu packages.
>
> Cheers,
> Markus
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> 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: Michael D. <md...@st...> - 2009年03月31日 14:42:01
Which backend are you using? I suspect this is actually a bug in the GUI 
framework being used, which we could rule out by running a simple script 
to do something basic (like show a window) and see if we get the same 
warning.
Mike
sigeti wrote:
> Dear Matplotlib Folks,
>
> When I run pylab.plot, I get a weird warning:
>
> ** (python:20754): WARNING **: Couldn't connect to system bus
>
> ** (python:20754): WARNING **: Couldn't connect to system bus
> <matplotlib.lines.Line2D object at 0x1225850>
>
> (Note that this was copied by hand because the system on which I run
> Matplotlib is currently unable to connect to the global internet.)
>
> The first line really is repeated.
>
> The number after "python:" changes from one instance of the warning to
> another.
>
> I am running:
>
> Red Hat Enterprise Linux ES release 4 (Nahant Update 3)
>
> At least, that is what is in /etc/redhat-release.
>
> The warning is not fatal and I can display what I attempted to plot with
> pylab.show. However, the warning has a significant impact on the
> interactive usability of Python and matplotlib as a replacement for Matlab.
>
> Anyone have any suggestions or observations?
>
> Yours,
> David Sigeti
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Robert C. <cim...@nt...> - 2009年03月31日 13:56:40
Attachments: log.py
Hi all!
I have a long running (non-GUI) python application, that needs to plot
some curves and update them in time, as new data are computed. I'm
well aware of ezplot, but would like to use a 
matplotlib-multiprocessing-only solution, as I have already enough
dependencies.
The best thing I have come so far with is essentially in the attached 
script (I stripped all unneeded dependencies and fancy stuff). It works 
quite well in terms that it plots as the data arrive, but I cannot find 
a way how to stop it cleanly. At the end, it just hangs (Ctrl-C does not 
help). I would appreciate any hints on what is wrong.
There are two classes: NBPlot spawns the new process and feeds it the 
data, ProcessPlotter is the "remote" plotter class plotting the data as 
they arrive. The plot update is done using gobject.timeout_add() 
according to the matplotlib examples. It can be run as:
$ python log.py
Best regards and thanks for your suggestions,
r.
From: John H. <jd...@gm...> - 2009年03月31日 12:58:06
On Tue, Mar 31, 2009 at 3:40 AM, Matthias Michler
<Mat...@gm...> wrote:
>> Hmm...i am also curious if it is possible to display the tick markers
>> inside the graph.
There is an rc parameter (see
http://matplotlib.sourceforge.net/users/customizing.html) controlling
this
 xtick.direction : in # direction: in or out
and ditto for ytick.
JDH
From: John H. <jd...@gm...> - 2009年03月31日 12:55:22
On Tue, Mar 31, 2009 at 3:33 AM, Matthias Michler
<Mat...@gm...> wrote:
>
> Hello,
>
> I'm not familiar with the draw_artist functionality, but for me there seems
> to to be the following replacement needed (due to a typo):
>
> self.ax.draw_artist(plt.contourf) -> self.ax.draw_artist(self.contour)
>
> because otherwise you are trying to draw a matplotlib function, which seems to
> be not reasonable and explains the error, because this function has no
> attribute 'draw'.
Yes, that looks like the problem, but not the solution. self.contour
is the return value of ax.contourf, which is a ContourSet.
Unfortunately, the matplotlib.contour documentation has not yet been
ported to the sphinx/rest doc system (Eric, hint, hint). But you can
read the docs in the source of matplotlib/contour.py or in the python
shell with help matplotlib.countour.ContourSet. To do what it looks
like you are trying to do, if you want to force a draw on the contour
artists (which are matplotlib.collection.Collection instances), you
would do
 self.contour = ax.contourf(...)
 for col in self.contour.collections:
 ax.draw_artist(col)
JDH
From: Cohen-Tanugi J. <co...@lp...> - 2009年03月31日 12:10:50
yes I can exactly reproduce your error. Something is fishy with errorbar 
and log scales....
Johann
Matthias Michler wrote:
> Hello list,
>
> may be the last message got lost among the lots of mpl-mails, but I really 
> want to know if anyone else can reproduce this behaviour and if this 
> behaviour is expected.
>
> Thanks in advance for any comments.
>
> I still get the same error with matplotlib
> __version__ : '0.98.6svn'
> __revision__ : '$Revision: 6887 $'
>
> best regards Matthias
>
> On Tuesday 03 March 2009 17:35:49 Matthias Michler wrote:
> 
>> Hello list,
>>
>> in the small example below with xscale and yscale logarithmic I'm not able
>> to set the xlabel inside the axes initialisation. The error output is
>> attached. It doesn't happen if I use the pylab command 'xlabel' or set one
>> of the scalings to linear.
>>
>> Is this a bug or do I miss anything?
>>
>> Thanks in advance for any hints.
>>
>> regards Matthias
>>
>> 
>>> -------------------------------------------------
>>> 
>> import matplotlib.pyplot as plt
>>
>> ax = plt.subplot(111, autoscale_on=False,
>> xscale="log", yscale="log",
>> xlim=(1, 10**4), ylim=(10**-4, 1),
>> xlabel="logx",
>> )
>> #plt.xlabel('logx')
>> plt.show()
>>
>> 
>>> -------------------------------------------------------
>>> 
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Cohen-Tanugi J. <co...@lp...> - 2009年03月31日 12:07:16
yes exactly....
I should have provided a test case, thanks for following up!
Johann
Matthias Michler wrote:
> Hello Johann,
>
> is the problem you are reporting the one I observe in the attached picture? 
> Namely some vertical and horizontal lines are missing when using 
> yscale="log". More precisely everything below y=1 seems to be missing.
>
> The picture was generated with the code below and
> matplotlib.__version__ = '0.98.6svn'
> matplotlib.__revision__ = '$Revision: 6887 $'
>
> best regards Matthias
>
> ###############################
> import numpy as np
> import matplotlib.pyplot as plt
>
> plt.subplot(111, xscale="log", yscale="log")
> x = 10.0**np.linspace(0.0, 2.0, 20)
> y = x**2.0
> plt.errorbar(x, y, xerr=0.1*x, yerr=5.0+0.75*y)
> plt.show()
> ################################
> On Friday 27 March 2009 16:12:12 Cohen-Tanugi Johann wrote:
> 
>> Hello, what is the best way to get log log plots with error bars? I
>> tried putting log10() everywhere but as I was afraid results look ugly....
>> thanks,
>> johann
>> 
>>
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------------
>> 
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
From: Ken S. <kts...@gm...> - 2009年03月31日 06:34:24
On Tue, Mar 31, 2009 at 2:16 AM, Jouni K. Seppänen <jk...@ik...> wrote:
> Use fig.add_axes([0,0,1,1],frameon=False) instead - add_subplot reserves
> some space for a title, axis labels, etc.
>
Great, that works. I have noticed that when I use ticks and labels,
the border sometimes cuts things off (for small images or large text).
 But, I can just adjust the axes position for now.
thanks,
Ken
From: Jouni K. S. <jk...@ik...> - 2009年03月31日 06:16:33
Ken Schutte <kts...@gm...> writes:
> Is it possible to control (actually remove) the amount of white space
> padded to a figure when saving to a file? For example, the white
> border found on the output of something like the following:
[...]
> ax = fig.add_subplot(111,frameon=False)
Use fig.add_axes([0,0,1,1],frameon=False) instead - add_subplot reserves
some space for a title, axis labels, etc.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Ken S. <kts...@gm...> - 2009年03月31日 05:44:25
Is it possible to control (actually remove) the amount of white space
padded to a figure when saving to a file? For example, the white
border found on the output of something like the following:
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
fig = plt.figure()
ax = fig.add_subplot(111,frameon=False)
ax.add_artist(mpatches.Rectangle((0,0), 1, 1, fc='gray', ec='r'))
ax.set_xticks([])
ax.set_yticks([])
ax.set_xbound([0,1])
ax.set_ybound([0,1])
fig.set_size_inches(3,3)
fig.savefig("test.eps")
15 messages has been excluded from this view by a project administrator.

Showing results of 394

1 2 3 .. 16 > >> (Page 1 of 16)
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 によって変換されたページ (->オリジナル) /