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



Showing 15 results of 15

From: Eric F. <ef...@ha...> - 2009年09月16日 23:52:47
Werner,
>> Instead, it looks to me like the best solution is the one you provided 
>> at the very bottom of http://www.py2exe.org/index.cgi/MatPlotLib.
> I am happy with what ever change is done as long as it also works for
> py2exe'd application.
> 
I have applied this fix to the branch and the trunk, so wxversion will 
not be imported by py2exe'ed programs.
Eric
From: Jae-Joon L. <lee...@gm...> - 2009年09月16日 22:37:20
Attachments: svg_clip.diff
Thanks for reporting the problem.
I can reproduce this error in the svn trunk.
My diagnosis is that this is because the clip mask is not correctly
set, i.e., the mask path is not properly flipped in the svg backend.
I was able to solve this particular problem using the attached patch.
But, i'm not sure if this patch is a general solution. So, I hope
other developers step in.
Bartosz, below is a workaround you may use meanwhile. Note that the
workaround will give correct result only for svg backend.
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_axes([0.4, 0.4, 0.25, 0.25], polar=True)
# modify the ax.patch transform to work around with svg backend bug
import matplotlib.transforms as mtransforms
flipped_transAxes = mtransforms.BboxTransformTo(ax.bbox) \
 + mtransforms.Affine2D().scale(1.0,
-1.0).translate(0., 72*fig.get_figheight())
ax.patch.set_transform(flipped_transAxes)
ax.xaxis.set_clip_path(ax.patch)
ax.yaxis.set_clip_path(ax.patch)
theta1 = np.pi/4
ax.plot([theta1, theta1], [0, 1], '-')
plt.savefig('test_polar.svg')
plt.savefig('test_polar.png')
Regards,
-JJ
On Wed, Sep 16, 2009 at 2:56 PM, Bartosz Telenczuk
<b.t...@bi...> wrote:
> Dear all,
>
> I have a problem with exporting polar plots to SVG. When attached to
> axes which are not centered in the figure, the content (grids, data,
> etc.) seems not to be shifted correctly with the axes. However, when I
> plot it directly to the screen or export to PNG everything is fine.
>
> Here is an example reproducing this error:
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> fig = plt.figure()
> ax = fig.add_axes([0.4, 0.4, 0.25, 0.25], polar=True)
>
> theta1 = np.pi/4
> ax.plot([theta1, theta1], [0, 1], '-')
>
> plt.savefig('test_polar.svg')
> plt.savefig('test_polar.png')
> plt.show()
>
> I was able to reproduce the problem it in matplotlib 0.99.0 (Backend:
> GTKAgg).
>
>
> Cheers,
>
> Bartosz
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Thomas R. <tho...@gm...> - 2009年09月16日 22:07:27
Hello,
The make.osx file is now required (or at least recommended) to build 
matplotlib on MacOS X, but the file is absent from the 0.9.1 RC1 
tarfile. Is this an oversight, or is it deliberate?
Thanks,
Thomas
From: Bartosz T. <b.t...@bi...> - 2009年09月16日 19:32:47
Dear all,
I have a problem with exporting polar plots to SVG. When attached to
axes which are not centered in the figure, the content (grids, data,
etc.) seems not to be shifted correctly with the axes. However, when I
plot it directly to the screen or export to PNG everything is fine.
Here is an example reproducing this error:
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_axes([0.4, 0.4, 0.25, 0.25], polar=True)
theta1 = np.pi/4
ax.plot([theta1, theta1], [0, 1], '-')
plt.savefig('test_polar.svg')
plt.savefig('test_polar.png')
plt.show()
I was able to reproduce the problem it in matplotlib 0.99.0 (Backend:
GTKAgg).
Cheers,
Bartosz
From: Gökhan S. <gok...@gm...> - 2009年09月16日 19:25:50
On Tue, Sep 15, 2009 at 1:24 AM, redrum <jva...@ho...> wrote:
>
> Hi,
>
> I have a few questions about the loglog plot :
>
> 1- Is there a way to a have axis format with real numbers rather than
> numbers with exponent ?
>
>
import matplotlib.pyplot as plt
ax1 = plt.gca()
ax1.yaxis.set_major_formatter(ticker.FormatStrFormatter("%.2f"))
You can check formatting options from
http://docs.python.org/library/stdtypes.html#string-formatting-operations
> 2- I would like to have a grid not only for 10^2, 10^3, 10^4, 10^5 ... but
> also for the minor axis ticks. is it possible ?
>
You can use plt.yticks() to get new ticks as well as grids. Do you know how
to make ticklabels like 5x10^2 etc...? This I couldn't figure yet.
> 3- I use loglog to plot parallel lines. How can I have the function label
> directly displaid next to the plotted straight lines ?
>
> Thanks for your tips.
>
plt.text and some fine-tuning?
-- 
Gökhan
From: S.Selvam <s.s...@gm...> - 2009年09月16日 18:06:33
On Wed, Sep 16, 2009 at 6:56 PM, S.Selvam <s.s...@gm...> wrote:
> Hi all,
>
> Few days back i came to know about python-matplotlib module when looking
> at segypy(seismic data processsing) python module.It uses pylab.plot(x,y...)
> to plot traces.
>
> But the issue is it plots the complete dataset in a single view.I would
> like to have plots with decent intervel and have scorllbars.Is there
> anything do be done with our matpplotlib functions ?
>
> If it is irrelevant to matplotlib (rather something to be done with segypy
> trace processing ) ,kindly ignore this mail / guide me in right way.
>
>
> --
> Yours,
> S.Selvam
>
this is how the code looks,(a function in segypy module)
def wiggle(Data,SH,skipt=1,maxval=8,lwidth=.1):
 """
 wiggle(Data,SH)
 """
 import pylab
 print "Hello"
 t = range(SH['ns'])
 for i in range(0,SH['ntraces'],skipt):
 trace=Data[:,i]
 trace[0]=0
 trace[SH['ns']-1]=0
 pylab.plot(i+trace/maxval,t,color='red',linewidth=1)
 for a in range(len(trace)):
 if (trace[a]<0):
 trace[a]=0;
 pylab.fill(i+Data[:,i]/maxval,t,'k',linewidth=0)
 pylab.title(SH['filename'])
 pylab.grid(True)
 pylab.show()
-- 
Yours,
S.Selvam
From: Michael D. <md...@st...> - 2009年09月16日 16:12:36
Attachments: test.eps
Hmm... 0.91.2 works for me. What platform are you on?
When you view the attached file, do you see the "phi" in the title 
area? That can rule out a problem in your viewer.
If that works for you, can you send me the .eps file you generated?
Mike
Diaboflo wrote:
>
> Michael Droettboom-3 wrote:
> 
>> Can you send the output of
>>
>> >>> import matplotlib
>> >>> matplotlib.__version__
>>
>> It's possible this is a bug that has already been fixed in the 
>> development version, but I'd like to confirm that by running the same 
>> version that you have.
>>
>> Mike
>>
>> 
>
> Here you go:
>
> 
>>>> import matplotlib
>>>> matplotlib.__version__
>>>> 
> '0.91.2'
> 
>
> Flo
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Diaboflo <fh...@hw...> - 2009年09月16日 16:03:38
Michael Droettboom-3 wrote:
> 
> Can you send the output of
> 
> >>> import matplotlib
> >>> matplotlib.__version__
> 
> It's possible this is a bug that has already been fixed in the 
> development version, but I'd like to confirm that by running the same 
> version that you have.
> 
> Mike
> 
Here you go:
>>> import matplotlib
>>> matplotlib.__version__
'0.91.2'
>>> 
Flo
-- 
View this message in context: http://www.nabble.com/Latex-characters-don%27t-show-when-I-save-to-eps-tp25433829p25475534.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael D. <md...@st...> - 2009年09月16日 15:58:08
Can you send the output of
 >>> import matplotlib
 >>> matplotlib.__version__
It's possible this is a bug that has already been fixed in the 
development version, but I'd like to confirm that by running the same 
version that you have.
Mike
Diaboflo wrote:
> The simplest case would be:
>
> import pylab
> pylab.plot([1,2])
> pylab.xlabel("$\phi$")
> pylab.savefig("fig.png")
> pylab.savefig("fig.eps")
>
> The png has the xlabel as phi, the xlabel in the eps file is just empty.
>
> I use python 2.5, don't really know which version of matplotlib is installed
> but it is not older than a year.
>
> Here the latex part of matplotlibrc:
>
> ### LaTeX customizations. See
> http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
> #text.usetex : False # use latex for all text handling. The
> following fonts
> ...
> #text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for
> handling
> ...
> #text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX
> FAILURES
> ...
> #text.dvipnghack : False # some versions of dvipng don't handle
> ...
> #text.markup : 'plain' # Affects how text, such as titles and
> labels, are
>
> Thanks for your answers so far.
>
> Diaboflo
>
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Diaboflo <fh...@hw...> - 2009年09月16日 15:54:24
Hi,
no, this gives the same result: Fine with $\Delta$ but not with $\phi$ :(
Flo
Darren Dale-3 wrote:
> 
> Does this help:
> pylab.xlabel(r"$\phi$")
> 
> 
-- 
View this message in context: http://www.nabble.com/Latex-characters-don%27t-show-when-I-save-to-eps-tp25433829p25475329.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jeff P. <jef...@ya...> - 2009年09月16日 15:47:20
Hello,
thank you for the respone. I am not working in such a file. I am experiencing strange behaviors when trying to import matplotlib. The error message "AttributeError: 'module' object has no attribute 'backends'" seems to appear depending upon how I import matplotlib. 
 
For example my wxApp is a simple frame holding a canvas and figure and a matplotlib toolbar. My canvas is a subclass of matplotlib's canvas and my figure is a subclass of matplotlib's Figure, my subclass modules are called myCanvas and myFigure. 
 
the wxApp module import as follows:
import matplotlib
import myCanvas
 
the myCanvas module imports as follows:
import matplotlib
import myFigure
 
the myFigure module imports as follows:
import matplotlib
matplotlib.use('WXAgg')
matplotlib.interactive(False)
matplotlib.backends.backend_wxagg._use_accelerator(True)
 
In this case the error occurs in the myFigure module where I call use_accelerator:
"myFigure.py", line 19, in <module> matplotlib.backends.backend_wxagg._use_accelerator(True)
AttributeError: 'module' object has no attribute 'backends'"
If I comment out the call to use_accelerator, I get this message:
AttributeError: 'module' object has no attribute 'figure' and this occurs at the start of my subclass "class Figure(matplotlib.figure.Figure)"
 
Now everything works just great if in the wxApp module I do the following:
import matplotlib
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
import myCanvas
 
I can wrestle my way through this so that it appears to work ok. However I would prefer to understand what is happending and code this properly. 
 
Also, 
(1) I am not sure whether I need to call matplotlib.use('WxAgg') or if it is implied when I import the WxAgg backend. 
(2) what is the accelerator
(3) do I need to call matplotlib.interactive(False) in each module using matplotlib?
 
thanks for the help!
Jeff
--- On Mon, 9/14/09, Damon McDougall <dam...@gm...> wrote:
From: Damon McDougall <dam...@gm...>
Subject: Re: [Matplotlib-users] error locating backends module
To: "Jeff Peery" <jef...@ya...>
Date: Monday, September 14, 2009, 3:16 PM
Hi Jeff,
You don't happen to be in the same directory as a folder called 'matplotlib' when trying to import matplotlib.backends, do you? If so, try moving to a different directory before invoking python and importing matplotlib.backends.
Regards,
--Damon
On 14 Sep 2009, at 22:52, Jeff Peery wrote:
hello,
I'm trying to import matplotlib.backends but I get a message indicating that matplotlib has no module 'backends'. So I looked to confirm that it was there and it is. I also checked if other modules where available (by importing them from the command line) and it appears that all the module are available but NOT any of the packages located in the matplotlib installation folder.
 
I just downloaded the latest matplotlib and installed it on a brand new machine that is running vista. I'm running python 2.6.
 
how do I fix this problem?
 
thanks,
Jeff
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
From: Darren D. <dsd...@gm...> - 2009年09月16日 15:46:56
On Wed, Sep 16, 2009 at 11:13 AM, Diaboflo <fh...@hw...> wrote:
>
> The simplest case would be:
>
> import pylab
> pylab.plot([1,2])
> pylab.xlabel("$\phi$")
Does this help:
pylab.xlabel(r"$\phi$")
> pylab.savefig("fig.png")
> pylab.savefig("fig.eps")
>
> The png has the xlabel as phi, the xlabel in the eps file is just empty.
>
> I use python 2.5, don't really know which version of matplotlib is installed
> but it is not older than a year.
>
> Here the latex part of matplotlibrc:
>
> ### LaTeX customizations. See
> http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
> #text.usetex     : False # use latex for all text handling. The
> following fonts
> ...
> #text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for
> handling
> ...
> #text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX
> FAILURES
> ...
> #text.dvipnghack   : False # some versions of dvipng don't handle
> ...
> #text.markup     : 'plain' # Affects how text, such as titles and
> labels, are
>
> Thanks for your answers so far.
From: Diaboflo <fh...@hw...> - 2009年09月16日 15:33:17
The simplest case would be:
import pylab
pylab.plot([1,2])
pylab.xlabel("$\phi$")
pylab.savefig("fig.png")
pylab.savefig("fig.eps")
The png has the xlabel as phi, the xlabel in the eps file is just empty.
I use python 2.5, don't really know which version of matplotlib is installed
but it is not older than a year.
Here the latex part of matplotlibrc:
### LaTeX customizations. See
http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
#text.usetex : False # use latex for all text handling. The
following fonts
...
#text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for
handling
...
#text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX
FAILURES
...
#text.dvipnghack : False # some versions of dvipng don't handle
...
#text.markup : 'plain' # Affects how text, such as titles and
labels, are
Thanks for your answers so far.
Diaboflo
-- 
View this message in context: http://www.nabble.com/Latex-characters-don%27t-show-when-I-save-to-eps-tp25433829p25474537.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael D. <md...@st...> - 2009年09月16日 13:58:51
I can't reproduce this here, but your settings may be different than 
mine. What rcParams have you specified in your matplotlibrc (in 
particular, is usetex on or off)? What version of matplotlib?
Mike
Diaboflo wrote:
> Hi,
> I have a strange problem with matplotlib: I use the greek character phi as a
> label ($\phi$). When I display the diagram everything looks fine, only when
> I save to an eps file, the phi dissappears (emplty space instead). Some
> other characters (\mu, \Delta) don't have this problem. Does anyone have an
> idea what the problem could be?
> Cheers,
> Diaboflo
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: S.Selvam <s.s...@gm...> - 2009年09月16日 13:26:24
Hi all,
 Few days back i came to know about python-matplotlib module when looking
at segypy(seismic data processsing) python module.It uses pylab.plot(x,y...)
to plot traces.
But the issue is it plots the complete dataset in a single view.I would like
to have plots with decent intervel and have scorllbars.Is there anything do
be done with our matpplotlib functions ?
If it is irrelevant to matplotlib (rather something to be done with segypy
trace processing ) ,kindly ignore this mail / guide me in right way.
-- 
Yours,
S.Selvam

Showing 15 results of 15

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