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

Showing results of 509

<< < 1 .. 8 9 10 11 12 .. 21 > >> (Page 10 of 21)
From: per f. <per...@gm...> - 2009年07月17日 22:12:20
hi all,
i am plotting two distinct lines, one of the format '-o' the other of the
format '-s' -- i.e. one line with circular markers the other with a square
marker. when i add a legend to the figure, it gives a legend that looks like
this:
o---o label of circular marker line
s---s label of square marker line
however, in these types of plots, it's standard for the line in the legend
to only have *one* marker. meaning the legend should look like this:
--o-- label of circular marker line
--s-- label of square marker line
is there a way to get this modified legend appearance?
second question: how can i make the legend altogether smaller? or at least
make the label text font smaller?
thanks.
From: jan_strube <cur...@gm...> - 2009年07月17日 22:07:51
Hi Jouni,
Jouni K. Seppänen wrote:
> 
> How about axhline?
> 
Yes! That's what I wanted. Thanks.
>> The eps doesn't get filled with the correct colors, and the pdf and
>> the svg don't work at all.
> 
> But there is a pdf file at
> 
> https://jstrube.web.cern.ch/jstrube/matplotlib_testcase/lambdaPbarGamma_all.pdf
> 
> When you say that pdf doesn't "work at all", do you mean that the hatch
> patterns are missing?
> 
It's a hack to get it working at all. I tried to fix the error message
below, but as a result there are no hatch patterns...
The error message is
 File "matplotlib_bug.py", line 75, in <module>
 pl.savefig('lambdaPbarGamma_all.pdf')
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/pyplot.py",
line 354, in savefig
 return fig.savefig(*args, **kwargs)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/figure.py",
line 1002, in savefig
 self.canvas.print_figure(*args, **kwargs)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/backend_bases.py",
line 1476, in print_figure
 **kwargs)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/backends/backend_pdf.py",
line 2000, in print_pdf
 self.figure.draw(renderer)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/artist.py",
line 46, in draw_wrapper
 draw(artist, renderer, *kl)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/figure.py",
line 774, in draw
 for a in self.axes: a.draw(renderer)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/artist.py",
line 46, in draw_wrapper
 draw(artist, renderer, *kl)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/axes.py",
line 1826, in draw
 a.draw(renderer)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/artist.py",
line 46, in draw_wrapper
 draw(artist, renderer, *kl)
 File
"/home/jstrube/local/lib64/python2.6/site-packages/matplotlib/patches.py",
line 326, in draw
 renderer.draw_path(gc, tpath, affine, rgbFace)
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/backends/backend_pdf.py",
line 1307, in draw_path
 self.file.output(self.gc.paint())
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/backends/backend_pdf.py",
line 1739, in paint
 if self._fillp():
 File
"/home/jstrube/local//lib64/python2.6/site-packages/matplotlib/backends/backend_pdf.py",
line 1723, in _fillp
 (len(self._fillcolor) <= 3 or self._fillcolor[3] != 0.0))
TypeError: object of type 'NoneType' has no len()
This is the case not only for the pdf backend, but for the qt4agg backend as
well.
This is also reproducible under linux.
> I just tried examples/pylab_examples/hatch_demo.py, and both the pdf and
> svg backends produced correct-looking output. Does hatch_demo.py work
> correctly in your environment?
> 
Yes, the example works just fine. I am attaching a self-contained example to
reproduce the problem.
Thanks for your help.
Cheers,
 Jan
http://www.nabble.com/file/p24542241/matplotlib_bug.py matplotlib_bug.py 
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge 
This is your chance to win up to 100,000ドル in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
View this message in context: http://www.nabble.com/plotting-problems-in-qt4agg-backend-on-Mac-OS-X-tp24499919p24542241.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Christophe D. <chr...@vh...> - 2009年07月17日 21:04:06
That's great, thanks.
-----Original Message-----
From: Jae-Joon Lee [mailto:lee...@gm...]
Sent: Fri 17/07/2009 15:33
To: Christophe Dupre
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Annotation on an axis
 
Drawing box around a text is quite easy.
http://matplotlib.sourceforge.net/examples/pylab_examples/fancytextbox_demo.html
To place a text in a way like ticklabels, you need to use blended transform.
The short example may give you some starting point.
-JJ
from matplotlib.transforms import blended_transform_factory
ax = subplot(111)
# x position in axes coordinate : 1.02
# y position in data coordinate : 0.3
t = ax.text(1.02, 0.3, "label", ha="left",
 transform=blended_transform_factory(ax.transAxes,
 ax.transData),
 bbox=dict(boxstyle="round", fc="cyan"),
 )
On Fri, Jul 17, 2009 at 12:51 PM, Christophe
Dupre<chr...@vh...> wrote:
> Hello,
>
> I am trying to add some annotations onto an axis as shown in the attached picture.
> Is that do-able? If yes, any pointers on how to achieve this are welcome.
>
> Thanks,
>
> Christophe
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2009年07月17日 20:58:34
I'm not an expert on this issue, and I never used Russian language.
But here is my experience with unicode in matplotlib.
Matplotlib's own font rendering engine (based on truetype) does
support unicode rendering. But I don't think there is any support for
things like a fontset. And, as far as you specify the font file to be
used, you can draw unicode text.
Here is an example (this is to draw some Korean text). Modify this for
your need.
-JJ
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
plt.rcParams["text.usetex"] = False
import matplotlib.font_manager as fm
fp1=fm.FontProperties(fname="/users/research/lee/.fonts/Eunjin.ttf")
plt.text(0.5, 0.5, u"한글", fontproperties=fp1)
plt.show()
2009年7月17日 Alexander Bruy <vo...@ua...>:
> Hi, list!
> I want to use Russian or Ukrainian language in text within matplotlib plot.
> There is solution, which I know - it is possible when text rendered with external LaTeX:
>
> from matplotlib import rc
> rc('font',**{'family':'serif'})
> rc('text', usetex=True)
> rc('text.latex',unicode=True)
> rc('text.latex',preamble='\usepackage[utf8]{inputenc}')
> rc('text.latex',preamble='\usepackage[russian]{babel}')
>
> But LaTex is really large dependency, and many users don't want to install it. So my question.
> Is it possible to use Russian or Ukrainian language in text within matplotlib plot in another way than using LaTeX?
>
>
> Alexander Bruy
>
> -- реклама -----------------------------------------------------------
> Создай свой сайт бесплатно! www.hostpro.ua
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2009年07月17日 20:33:59
Drawing box around a text is quite easy.
http://matplotlib.sourceforge.net/examples/pylab_examples/fancytextbox_demo.html
To place a text in a way like ticklabels, you need to use blended transform.
The short example may give you some starting point.
-JJ
from matplotlib.transforms import blended_transform_factory
ax = subplot(111)
# x position in axes coordinate : 1.02
# y position in data coordinate : 0.3
t = ax.text(1.02, 0.3, "label", ha="left",
 transform=blended_transform_factory(ax.transAxes,
 ax.transData),
 bbox=dict(boxstyle="round", fc="cyan"),
 )
On Fri, Jul 17, 2009 at 12:51 PM, Christophe
Dupre<chr...@vh...> wrote:
> Hello,
>
> I am trying to add some annotations onto an axis as shown in the attached picture.
> Is that do-able? If yes, any pointers on how to achieve this are welcome.
>
> Thanks,
>
> Christophe
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jouni K. S. <jk...@ik...> - 2009年07月17日 20:27:06
Jan Strube <cur...@gm...> writes:
> The png roughly looks like I would expect (although I can't figure out
> how to plot a straight black horizontal line at y=0. pylab.plot
> doesn't seem to do what I want)
How about axhline?
> The eps doesn't get filled with the correct colors, and the pdf and
> the svg don't work at all.
But there is a pdf file at
https://jstrube.web.cern.ch/jstrube/matplotlib_testcase/lambdaPbarGamma_all.pdf
When you say that pdf doesn't "work at all", do you mean that the hatch
patterns are missing?
I just tried examples/pylab_examples/hatch_demo.py, and both the pdf and
svg backends produced correct-looking output. Does hatch_demo.py work
correctly in your environment?
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Jouni K. S. <jk...@ik...> - 2009年07月17日 20:07:00
per freem <per...@gm...> writes:
> then the horizontal line appears ON TOP of the other two lines -- i want it
> to be the opposite, i want the horizontal line to be in the background. how
> can i do this?
Use the zorder keyword.
http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Jarrod M. <mi...@be...> - 2009年07月17日 20:03:29
The early registration deadline for SciPy 2009 has been extended
until Wednesday, July 22, 2009. Please register (
http://conference.scipy.org/to_register )
by this date to take advantage of the reduced early registration rate.
Since we just announced the conference schedule, I was asked to
provide extra time for people to register. Fortunately, we were
able to get a few extra days from our vendors. But we will have to
place orders next Thursday, so this is the last time we will be able
to extend the deadline for registration.
The conference schedule is available here:
 http://conference.scipy.org/schedule
About the conference
--------------------
SciPy 2009, the 8th Python in Science conference, will be held from
August 18-23, 2009 at Caltech in Pasadena, CA, USA. The conference
starts with two days of tutorials to the scientific Python tools.
There will be two tracks, one for introduction of the basic tools to
beginners, and one for more advanced tools. The tutorials will be
followed by two days of talks. Both days of talks will begin with a
keynote address. The first day’s keynote will be given by Peter
Norvig, the Director of Research at Google; while, the second keynote
will be delivered by Jon Guyer, a Materials Scientist in the
Thermodynamics and Kinetics Group at NIST. The program committee will
select the remaining talks from submissions to our call for papers.
All selected talks will be included in our conference proceedings
edited by the program committee. After the talks each day we will
provide several rooms for impromptu birds of a feather discussions.
Finally, the last two days of the conference will be used for a number
of coding sprints on the major software projects in our community.
For the 8th consecutive year, the conference will bring together the
developers and users of the open source software stack for scientific
computing with Python. Attendees have the opportunity to review the
available tools and how they apply to specific problems. By providing
a forum for developers to share their Python expertise with the wider
commercial, academic, and research communities, this conference
fosters collaboration and facilitates the sharing of software
components, techniques, and a vision for high level language use in
scientific computing.
For further information, please visit the conference homepage:
http://conference.scipy.org.
Important Dates
---------------
* Friday, July 3: Abstracts Due
* Wednesday, July 15: Announce accepted talks, post schedule
* Wednesday, July 22: Early Registration ends
* Tuesday-Wednesday, August 18-19: Tutorials
* Thursday-Friday, August 20-21: Conference
* Saturday-Sunday, August 22-23: Sprints
* Friday, September 4: Papers for proceedings due
Executive Committee
-------------------
* Jarrod Millman, UC Berkeley, USA (Conference Chair)
* Gaël Varoquaux, INRIA Saclay, France (Program Co-Chair)
* Stéfan van der Walt, University of Stellenbosch, South Africa
(Program Co-Chair)
* Fernando Pérez, UC Berkeley, USA (Tutorial Chair)
From: Eric F. <ef...@ha...> - 2009年07月17日 18:57:30
Johann Rohwer wrote:
> After upgrading to the latest Mandriva Linux I can no longer compile 
> Matplotlib. The following error occurs:
> 
> ================
> In file included from src/backend_agg.cpp:37:
> src/swig_runtime.h: In function 'void SWIG_Python_AddErrorMsg(const 
> char*)':
> src/swig_runtime.h:859: error: format not a string literal and no 
> format arguments
> error: command 'gcc' failed with exit status 1
> ================
That file is a fossil, along with agg.cxx. Comment out its inclusion in 
backend_agg.cpp, and I think everything will build. I will make the 
changes in svn.
Eric
> 
> This happens with all of 0.98.5.2, 0.98.5.3 and svn versions of 
> matplotlib.
> 
> System Info:
> ============================================================================
> BUILDING MATPLOTLIB
> matplotlib: 0.98.6svn
> python: 2.6.1 (r261:67515, Apr 12 2009, 04:14:16) 
> [GCC
> 4.3.2]
> platform: linux2
> 
> REQUIRED DEPENDENCIES
> numpy: 1.3.0
> freetype2: 9.20.3
> 
> OPTIONAL BACKEND DEPENDENCIES
> libpng: 1.2.35
> Tkinter: Tkinter: 67083, Tk: 8.6, Tcl: 8.6
> * Guessing the library and include directories 
> for
> * Tcl and Tk because the tclConfig.sh and
> * tkConfig.sh could not be found and/or parsed.
> wxPython: 2.8.9.2
> * WxAgg extension not required for wxPython >= 
> 2.8
> Gtk+: gtk+: 2.16.1, glib: 2.20.1, pygtk: 2.14.1,
> pygobject: 2.16.1
> Mac OS X native: no
> Qt: no
> Qt4: Qt: 4.5.0, PyQt4: 4.4.4
> Cairo: 1.8.2
> 
> OPTIONAL DATE/TIMEZONE DEPENDENCIES
> datetime: present, version unknown
> dateutil: 1.4.1
> pytz: 2008i
> 
> OPTIONAL USETEX DEPENDENCIES
> dvipng: 1.9
> ghostscript: 8.64
> latex: 3.141592
> pdftops: 0.10.6
> ============================================================================
> 
> SWIG version is 1.3.38
> 
> Any ideas?
> Johann
> 
> 
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge 
> This is your chance to win up to 100,000ドル in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize 
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: per f. <per...@gm...> - 2009年07月17日 18:52:24
hi all,
i am plotting several lines together in a plot. i'd like some of the lines
to be "behind" the other ones -- i.e., when the two lines intersect, i want
the most recently plotted line to be on top of the previously plotted lines.
in general, this is true but it seems to be violated by plt.axhline. for
example if i have
plt.axhline(...plot horizontal line..., color='red')
plt.plot(...plot 1st line....)
plt.plot(...plot 2nd line...)
then the horizontal line appears ON TOP of the other two lines -- i want it
to be the opposite, i want the horizontal line to be in the background. how
can i do this?
thank you
From: Darren D. <dsd...@gm...> - 2009年07月17日 18:12:42
2009年7月17日 Alexander Bruy <vo...@ua...>
> Hi, list!
>
> I have a problem with embedding matplotlib in Qt based GUI. I read manual
> and look at
> example "embedding_in_qt4.py". I create GUI with QtDesigner. For matplotlib
> plot I create
> a QWidget. Then in runtime I embed a matplotlib plot im my GUI, into this
> QWidget. Here some code:
>
> from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
> FigureCanvas
> from matplotlib.figure import Figure
>
> class dlgStatist( QDialog, Ui_dlgStatistics ):
> def __init__( self, iface ):
> QDialog.__init__( self )
> self.iface = iface
> self.setupUi( self )
>
> # prepare figure
> self.figure = Figure()
> #self.figure.set_figsize_inches( ( 4.3, 4.2 ) )
> self.axes = self.figure.add_subplot( 111 )
> self.figure.suptitle( "Frequency distribution", fontsize =
> 12 )
> self.axes.grid( True )
> self.canvas = FigureCanvas( self.figure )
> self.canvas.setParent( self.widgetPlot )
> .......
>
> All looks fine, but when user change window size, matplotlib plot doesn't
> resized. I try to set
> SizePolicy to matplotlib figure (as explained in example) but this don't
> help.
> Where is my mistake and can anyone give me a little example how to embed
> matplotlib plot
> in GUI created with QtDesigner? I really need resizible plot into Qt
> dialog.
>
>
> Sorry for my bad English, I'm Ukrainian.
>
> Python 2.5.4
> PyQT 4.4.3
> numpy 1.3.0
> matplotlib 0.98.5.3
>
Please post a short, complete, self-contained script demonstrating the
problem.
From: Alexander B. <vo...@ua...> - 2009年07月17日 17:37:42
Hi, list!
I have a problem with embedding matplotlib in Qt based GUI. I read manual and look at
example "embedding_in_qt4.py". I create GUI with QtDesigner. For matplotlib plot I create
a QWidget. Then in runtime I embed a matplotlib plot im my GUI, into this QWidget. Here some code:
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
class dlgStatist( QDialog, Ui_dlgStatistics ):
	def __init__( self, iface ):
		QDialog.__init__( self )
		self.iface = iface
		self.setupUi( self )
		
		# prepare figure
		self.figure = Figure()
		#self.figure.set_figsize_inches( ( 4.3, 4.2 ) )
		self.axes = self.figure.add_subplot( 111 )
		self.figure.suptitle( "Frequency distribution", fontsize = 12 )
		self.axes.grid( True )
		self.canvas = FigureCanvas( self.figure )
		self.canvas.setParent( self.widgetPlot )
 .......
All looks fine, but when user change window size, matplotlib plot doesn't resized. I try to set
SizePolicy to matplotlib figure (as explained in example) but this don't help.
Where is my mistake and can anyone give me a little example how to embed matplotlib plot
in GUI created with QtDesigner? I really need resizible plot into Qt dialog.
Sorry for my bad English, I'm Ukrainian.
Python 2.5.4
PyQT 4.4.3
numpy 1.3.0
matplotlib 0.98.5.3
Alexander Bruy
-- реклама -----------------------------------------------------------
Создай свой сайт бесплатно! www.hostpro.ua
From: Alexander B. <vo...@ua...> - 2009年07月17日 17:09:52
Hi, list!
 I want to use Russian or Ukrainian language in text within matplotlib plot.
There is solution, which I know - it is possible when text rendered with external LaTeX:
from matplotlib import rc
rc('font',**{'family':'serif'})
rc('text', usetex=True)
rc('text.latex',unicode=True)
rc('text.latex',preamble='\usepackage[utf8]{inputenc}')
rc('text.latex',preamble='\usepackage[russian]{babel}')
But LaTex is really large dependency, and many users don't want to install it. So my question.
Is it possible to use Russian or Ukrainian language in text within matplotlib plot in another way than using LaTeX?
Alexander Bruy
-- реклама -----------------------------------------------------------
Создай свой сайт бесплатно! www.hostpro.ua
From: Christophe D. <chr...@vh...> - 2009年07月17日 17:03:26
Attachments: AxisAnnotation.jpg
Hello,
I am trying to add some annotations onto an axis as shown in the attached picture.
Is that do-able? If yes, any pointers on how to achieve this are welcome.
Thanks,
Christophe
From: Jae-Joon L. <lee...@gm...> - 2009年07月17日 16:26:18
Please post a simple, standalone script that reproduces your problem,
so that we can track down what is causing the problem. I don't think
there has been any report of a similar issue (but not sure). As far as
I know, autofmt_xdata only adjusts the alignment and rotation of the
ticklabels and does not change the font property.
-JJ
On Thu, Jul 16, 2009 at 10:55 AM, Domenico
Nappo<dom...@gm...> wrote:
> Whenever I try to use autofmt_xdate() on a Figure(), dates on x axis
> disappear...I guess this is related with something concerning font
> management...
> Anyone experienced this kind of issues?
>
> I use most recent versions of matplotlib, numpy, gtk2, pygtk on a Python 2.5
> platform (installed via binaries on a window xp machine).
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2009年07月17日 16:19:55
On Wed, Jul 15, 2009 at 3:23 PM, Louise
Loudermilk<lou...@gm...> wrote:
> Hi. I am trying to output multiple 2D graphs (subplots) in one figure
> (using pylab) for each time-step that the python code runs - basically an
> interactive graphs. We use the 'ion()' and 'imshow()' functions for this.
> I have many graphs to chose from, but say if I chose 4 graphs to output, all
> 4 will output for the 1st time step, but for every additional time step only
> the last graph will update. The first 3 will remain the same, as they were
> in the 1st time step. Has anyone has this problem? Any suggestions?
>
I'm not sure what exactly an issue here.
You want to know how to keep the first three graph during each step?
Can't you just clear the last axes, and redraw it.
e.g.,
self.subplot4.cla()
self.subplot4.imshow(...)
if you want to stick to the pylab interface (which I don't think a
good idea for application development),
sca(self.subplot4)
cla()
imshow(...)
A snippet of code does not help much.
Please take your time to create a small, standalone script that
reproduces your problem and post that on the mailing list.
Regards,
-JJ
> A portion of the O-O code is below. This function is called in another
> file. I tried to add notes where I thought they were helpful.
>
>   def multi_display(self, n=4):
>
>     ''' displaying multiple graphs '''
>
>     ion()
>     m = self.displayed_multi   # four input graph names (provided when
> function is called)
>     nsub = n   # no. of subgraphs/time step
>
>     for i in range(nsub): # for each subplot
>
>       p = i +1
>       exec ("self.subplot" + str(p) + " = subplot(2, 2, p)")  # OR
> subplot(2,2,p)
>
>       self.displayed = m[i]
>       self.display_stand()  # this calls the function below with
> 'self.displayed' in it.
>
> def display_stand(self): # displays individual graphs
>
>     if self.displayed == 'ht': # this is only one of the four graphs (or
> subplots)
>
>       vm = 0.0
>       vx = 40.0
>       t = 'Height (m)'
>       imshow(self.old_ht, vmin = vm, vmax = vx,
>        interpolation = 'nearest')
>       title(t)
>
> Thanks,
> Louise
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: plankton <and...@dl...> - 2009年07月17日 16:16:20
Greetings all,
I rotate a vector field and than I tried to interpolate it to a new grid
using griddata. 
CODE:
 x_grid_unique = unique(x_grid)
 y_grid_unique = unique(y_grid)
 x_meshgrid, y_meshgrid = meshgrid(x_grid_unique, y_grid_unique)
 x_rot_meshgrid = reshape(x_rot, [ len(x_meshgrid[:, 0]),
len(x_meshgrid[0, :])] )
 y_rot_meshgrid = reshape(y_rot, [ len(x_meshgrid[:, 0]),
len(x_meshgrid[0, :])] )
 u_rot_meshgrid = reshape(u_rot, [ len(x_meshgrid[:, 0]),
len(x_meshgrid[0, :])] )
 v_rot_meshgrid = reshape(v_rot, [ len(x_meshgrid[:, 0]),
len(x_meshgrid[0, :])] )
 u_interpolate = griddata(x_rot, y_rot, u_rot, x_rot_meshgrid, 
y_rot_meshgrid)
 v_interpolate = griddata(x_rot, y_rot, v_rot, x_rot_meshgrid, 
y_rot_meshgrid)
I unfortunately griddata returns some nan (It seems that there are multiple
occurrences of the same [X,Y] pair in the data). In matlab you can use
griddata with additional options e.g. ru =
griddata(nx,ny,nu,rx,ry,'linear', {'QJ'}) to fix this, but this seems to be
not possible using the griddata function in matplotlib. Is there any other
way to avoid a return of nan?
For any help many thanks in advance
Andreas
-- 
View this message in context: http://www.nabble.com/griddata-returns-nan-tp24537481p24537481.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2009年07月17日 15:57:26
To change the legend font size, you may change the "legend.fontsize"
in rcParams.
The change will be global. If you want to change the font size of some
particular legend, use the appropriate font property as the "prop"
keyword.
http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=legend#matplotlib.pyplot.legend
List of spacing parameters are also available in the above
documentation. Most of other spacing parameters are meant to scale
with the font size.
For legend position, take a look at the below legend guide.
http://matplotlib.sourceforge.net/users/plotting/legend.html#legend-location
However, I guess this will only work if you use svn version.
If you're not using svn version, you can have similar result by
creating a separate axes.
http://www.nabble.com/Stopping-Legend-From-Overlapping-the-Graph-td24213554.html#a24213554
Regards,
-JJ
On Thu, Jul 16, 2009 at 7:15 PM, Chuck Pepe-Ranney<cp...@mi...> wrote:
> Hello Users,
>
> I need some help with formatting a legend for a stacked bar graph. Each bar
> is segmented into ~35 categories so my legend ends up being a long mess
> overlapping my plot. How can I position my legend outside of the plot and
> reduce the spacing and fontsize for the text?
>
> Thanks,
>
> - Chuck
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2009年07月17日 15:43:28
On Thu, Jul 16, 2009 at 10:49 PM, per freem<per...@gm...> wrote:
> hi all,
>
> suppose i have am plotting several lines using 'plot', some are dashed
> (using '--') and some are ordinary solid lines. i am plotting several solid
> and several dashed lines, all in different colors, as in:
>
> for n in num_lines:
>  # plot dashed line
>  plot(line_x[n], line_y[n], '--', color=line_color[n], label="line %d"
> %(n))
>  # plot ordinary line in different color
>  plot(line_x[n], line_y[n], color=other_line_color[n], label="line %d"
> %(n))
>  ...
>
> If i plot n lines, i don't want the legend to show n-items, giving a
> separate key for each line. rather, i want it to display a legend containing
> a label for the dashed lines and a label for the solid lines, as in:
>
> Legend:
> [-- line of type A
> - line of type B]
>
> so 2 entries rather than as many entries as i have lines. how can i do this?
>
If you set "_nolegend_" as label, that line will not be displayed in the legend.
http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=legend#matplotlib.pyplot.legend
Or, you may manually select which lines to be displayed.
See the above documentation for more details.
> finally, how can i make it so the legend does not interfere with the plot?
> right now the lines appear "behind" the legend. it'd be great if the legend
> could be made to be in the background of the line (i.e. be transparent.)
>
reduce the zorder of the legend less than that of the lines.
http://matplotlib.sourceforge.net/api/artist_api.html?highlight=zorder#matplotlib.artist.Artist.set_zorder
e.g.,
l = legend()
l.set_zorder(0)
Regards,
-JJ
> thank you.
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2009年07月17日 15:33:39
"imshow" sets aspect=1 unless you changed your rcparams.
Unless aspect="auto", the axes position changes during the drawing time.
call imshow with aspect="auto"
or use set_aspect method.
http://matplotlib.sourceforge.net/api/axes_api.html?highlight=aspect#matplotlib.axes.Axes.set_aspect
Regards,
-JJ
On Thu, Jul 16, 2009 at 10:20 AM, Andrei Kopats<and...@gm...> wrote:
> Hello
>
> I have a little problem.
>
> On figure I have 2 Axes created by
>    fig = plt.figure(figsize = (16, 10), facecolor='w')
>    ax1 = fig.add_axes([0, 0, 1, 0.1])
>    ax2 = fig.add_axes([0.1, 0.19, 0.8, 0.72], autoscale_on=True)
> There are some text and images on it:
>    ...
>    drawing on ax1 and ax2
>    ...
>    ax1.imshow(arr, extent=[0.01, 0.29, 0.1, 0.95])
>    ax1.imshow(arr, extent=[0.75, 0.96, 0.5, 0.8])
>    ...
>
> My problem - when I plot the figure - ax1 changes it's geometry.
> Code:
>    print 'ax1:', ax1
>    print 'ax2:', ax2
>
>    plt.show()
>
>
>    print 'ax1:', ax1
>    print 'ax2:', ax2
>    print 'ax1 position changed during plt.show(). Why???'
>
> Output:
>
>    ax1: Axes(0,0;1x0.1)
>    ax2: Axes(0.1,0.19;0.8x0.72)
>    ax1: Axes(0.470649,0;0.0587025x0.1)
>    ax2: Axes(0.1,0.19;0.8x0.72)
>    ax1 position changed during plt.show(). Why???
>
> On resulting plot ax1 has position (0.470649,0;0.0587025x0.1), but
> desired are (0,0;1x0.1).
>
> Could anyone help me, or give an idea, why axes is moved, or give an
> advice, how to resolve this situation.
>
> Thank you
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2009年07月17日 15:26:23
Are you trying to run your script without opening a gui window?
If yes, "interacitve" is not what you want.
http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server
Anyhow, I had similar experience that some Tk application failed to
open over ssh connection. And sometimes, -Y option helped. If -Y does
not help, see if other backends work.
-JJ
On Fri, Jul 17, 2009 at 10:57 AM, John [H2O]<was...@gm...> wrote:
>
>
>
> John [H2O] wrote:
>>
>>
>> My $DISPLAY variable does change from time to time, but as I have it set
>> to interactive, why should this matter?
>>
>>
>
> I wanted to explain a little further. I have it set to interactive(False)
> sorry if there is confusion in my above statement.
> The reason my DISPLAY variable changes is that I am running the scripts on a
> remote machine and using ssh -X to login. So each time I log in, the DISPLAY
> variable may change.
>
>
> --
> View this message in context: http://www.nabble.com/non-interactive-runs-keep-crashing-due-to-DISPLAY-tp24535712p24536107.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: John [H2O] <was...@gm...> - 2009年07月17日 14:57:43
John [H2O] wrote:
> 
> 
> My $DISPLAY variable does change from time to time, but as I have it set
> to interactive, why should this matter?
> 
> 
I wanted to explain a little further. I have it set to interactive(False)
sorry if there is confusion in my above statement.
The reason my DISPLAY variable changes is that I am running the scripts on a
remote machine and using ssh -X to login. So each time I log in, the DISPLAY
variable may change. 
-- 
View this message in context: http://www.nabble.com/non-interactive-runs-keep-crashing-due-to-DISPLAY-tp24535712p24536107.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John [H2O] <was...@gm...> - 2009年07月17日 14:38:18
Hello,
I am trying to run a plotting script. I have my imports as such:
from matplotlib import interactive
interactive(False)
import matplotlib.pyplot as plt
But I am getting this error repeatedly:
 fig=figure(1,figsize=(8,6))
 File "/usr/lib/python2.6/dist-packages/matplotlib/pyplot.py", line 251, in
figure
 **kwargs)
 File
"/usr/lib/python2.6/dist-packages/matplotlib/backends/backend_tkagg.py",
line 90, in new_figure_manager
 window = Tk.Tk()
 File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1646, in __init__
 self.tk = _tkinter.create(screenName, baseName, className, interactive,
wantobjects, useTk, sync, use)
TclError: couldn't connect to display "localhost:10.0"
My $DISPLAY variable does change from time to time, but as I have it set to
interactive, why should this matter?
-- 
View this message in context: http://www.nabble.com/non-interactive-runs-keep-crashing-due-to-DISPLAY-tp24535712p24535712.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Johann R. <jr...@su...> - 2009年07月17日 10:14:43
After upgrading to the latest Mandriva Linux I can no longer compile 
Matplotlib. The following error occurs:
================
In file included from src/backend_agg.cpp:37:
src/swig_runtime.h: In function 'void SWIG_Python_AddErrorMsg(const 
char*)':
src/swig_runtime.h:859: error: format not a string literal and no 
format arguments
error: command 'gcc' failed with exit status 1
================
This happens with all of 0.98.5.2, 0.98.5.3 and svn versions of 
matplotlib.
System Info:
============================================================================
BUILDING MATPLOTLIB
 matplotlib: 0.98.6svn
 python: 2.6.1 (r261:67515, Apr 12 2009, 04:14:16) 
[GCC
 4.3.2]
 platform: linux2
REQUIRED DEPENDENCIES
 numpy: 1.3.0
 freetype2: 9.20.3
OPTIONAL BACKEND DEPENDENCIES
 libpng: 1.2.35
 Tkinter: Tkinter: 67083, Tk: 8.6, Tcl: 8.6
 * Guessing the library and include directories 
for
 * Tcl and Tk because the tclConfig.sh and
 * tkConfig.sh could not be found and/or parsed.
 wxPython: 2.8.9.2
 * WxAgg extension not required for wxPython >= 
2.8
 Gtk+: gtk+: 2.16.1, glib: 2.20.1, pygtk: 2.14.1,
 pygobject: 2.16.1
 Mac OS X native: no
 Qt: no
 Qt4: Qt: 4.5.0, PyQt4: 4.4.4
 Cairo: 1.8.2
OPTIONAL DATE/TIMEZONE DEPENDENCIES
 datetime: present, version unknown
 dateutil: 1.4.1
 pytz: 2008i
OPTIONAL USETEX DEPENDENCIES
 dvipng: 1.9
 ghostscript: 8.64
 latex: 3.141592
 pdftops: 0.10.6
============================================================================
SWIG version is 1.3.38
Any ideas?
Johann
From: william r. <wil...@gm...> - 2009年07月17日 06:02:39
I have recently been trying to build matplotlib from source under Vista
using mingw32. I have downloaded the win32static library from the
matplotlib page. Here is the error:
writing build\temp.win32-2.5\Release\src\ft2font.def
c:\Program Files\pythonxy\mingw\bin\g++.exe -mno-cygwin -mdll -static
--entry _DllMain@12 --output-lib
build\temp.win32-2.5\Release\src\libft2font.a --def
build\temp.win32-2.5\Release\src\ft2font.def -s
build\temp.win32-2.5\Release\src\ft2font.o
build\temp.win32-2.5\Release\src\mplutils.o
build\temp.win32-2.5\Release\cxx\cxxsupport.o
build\temp.win32-2.5\Release\cxx\cxx_extensions.o
build\temp.win32-2.5\Release\cxx\indirectpythoninterface.o
build\temp.win32-2.5\Release\cxx\cxxextensions.o -Lwin32_static\lib
-Lc:\python25\libs -Lc:\python25\PCBuild -lfreetype -lz -lpython25 -lmsvcr71
-o build\lib.win32-2.5\matplotlib\ft2font.pyd
g++: build\temp.win32-2.5\Release\src\libft2font.a: No such file or
directory
error: command 'g++' failed with exit status 1
It would seem that somehow it is attempting to link with libft2font.a
instead of creating it. Any ideas?
Thanks,
William
9 messages has been excluded from this view by a project administrator.

Showing results of 509

<< < 1 .. 8 9 10 11 12 .. 21 > >> (Page 10 of 21)
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 によって変換されたページ (->オリジナル) /