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






Showing results of 523

<< < 1 2 3 4 .. 21 > >> (Page 2 of 21)
From: John H. <jd...@gm...> - 2009年05月29日 16:23:27
On Fri, May 29, 2009 at 10:50 AM, Xavier Gnata <xav...@gm...> wrote:
>> I had the same problem and fixed it by changing just two lines of code in the axes.py (line 1812 and 1814). Just change the formatter in 'self.xaxis.major.formatter.set_scientific(sb)' to whatever you want (the same for y).
You don't need to modify the internals of axes.py -- just set the
formatter on the axes instance itself.
 http://matplotlib.sourceforge.net/search.html?q=codex+set_major_formatter
> Indeed, but it should really be fixed in the svn.
We could perhaps be a little smarter about this, but consider that one
can easily plot lines over images
In [30]: imshow(np.random.rand(512,512))
Out[30]: <matplotlib.image.AxesImage object at 0x151c4f4c>
In [31]: plot(np.arange(512), np.arange(512))
Since the plot can be a mix of images, polygons, lines, etc, it is not
obvious that the formatter should be int. We could trap the case
where you have only an image, no other data, and haven't set the
extent, but it would be complicated because you may add data to the
plot later and we would have to track that we had attempted to be
clever but we should now undo our cleverness. Our general philosophy
is to make is easy for you to customize when the default behavior
doesn't suit you, so try
 import matplotlib.ticker as ticker
 ax.xaxis.set_major_formatter(ticker.FormatStrFormatter('%d'))
 .. and ditto for yaxis ..
in addition to the ticks, you can customize how the coords appear in
the toolbar by setting
 ax.fmt_xdata = ticker.FormatStrFormatter('%d')
 ... and ditto for fmt_ydata
There are a variety of formatters available
 http://matplotlib.sourceforge.net/api/ticker_api.html
JDH
From: John H. <jd...@gm...> - 2009年05月29日 16:15:25
On Fri, May 29, 2009 at 10:25 AM, Paul Anton Letnes
<pau...@gm...> wrote:
> I'm trying to make a publication quality plot for a two-column latex
> article. I'm using latex for text processing, so the plot quality
> itself is impeccable. However, as I scale the plot size down, the
> legend becomes extremely large compared to the plot itself. Has
> anyone solved this problem in a good manner? I'm not willing to make
> do without the legend.
The major determinant of the legend is the fontsize, so if you want to
make a small figure in inches, you may want to make the legend font
smaller
 import matplotlib.font_manager as font_manager
 leg = ax.legend(loc='upper left', prop=font_manager.FontProperties(size=10))
JDH
From: Xavier G. <xav...@gm...> - 2009年05月29日 15:50:56
Indeed, but it should really be fixed in the svn.
Xavier
> Hi Xavier,
>
> I had the same problem and fixed it by changing just two lines of code in the axes.py (line 1812 and 1814). Just change the formatter in 'self.xaxis.major.formatter.set_scientific(sb)' to whatever you want (the same for y).
>
> But it would really be great to see your proposal as a standard.
>
>
> Greetings,
>
> David
>
>
>
> -------- Original-Nachricht -------- > Datum: 2009年5月24日 19:15:18 +0200 > Von: Xavier Gnata <xav...@gm...> > An: mat...@li... > Betreff: [Matplotlib-users] x= / y= labels default format is wrong > Hello all, > > I routinely work with images sizes > [1000,1000]. > There is a slight annoying problem whatever the backend I use: > Pixels coordinates default format is wrong. > It does not make sense to display "x=1.42e+03,y=1.92e+03". > Pixels coordinates should be formated *by default* as integers. > > Would it be possible to fix that? > > Steps to reproduce: > import numpy > import pylab > a=numpy.random.random((2000,2000)) > pylab.imshow(a,interpolation='Nearest') > > > Xavier > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. > Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://www.creativitycat.com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Chaitanya K. <ic...@gm...> - 2009年05月29日 15:39:05
Hi,
I usually fix the size of the figure when I produce it. I use rcparams
below for a single column plot. This usually solves the problem. What
you see is what you get in the final document if you use the same size
of the figure as used to produce it.
def paper_single():
 plt.rc('figure', figsize=(3.375,3.375))
 plt.rc('figure.subplot', left=0.15, right=0.97, bottom=0.1, top=0.95)
 plt.rc('lines', linewidth=1.5)
 plt.rc('font', size=10.0)
 plt.rc('xtick', labelsize='small')
 plt.rc('ytick', labelsize='small')
 plt.rc('legend', fontsize='medium')
Cheers,
Chaitanya
On Fri, May 29, 2009 at 5:25 PM, Paul Anton Letnes
<pau...@gm...> wrote:
> Howdy y'all!
>
> I'm trying to make a publication quality plot for a two-column latex
> article. I'm using latex for text processing, so the plot quality
> itself is impeccable. However, as I scale the plot size down, the
> legend becomes extremely large compared to the plot itself. Has
> anyone solved this problem in a good manner? I'm not willing to make
> do without the legend.
>
> cheers,
> Paul.
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Paul A. L. <pau...@gm...> - 2009年05月29日 15:25:59
Howdy y'all!
I'm trying to make a publication quality plot for a two-column latex 
article. I'm using latex for text processing, so the plot quality 
itself is impeccable. However, as I scale the plot size down, the 
legend becomes extremely large compared to the plot itself. Has 
anyone solved this problem in a good manner? I'm not willing to make 
do without the legend.
cheers,
Paul.
From: Ole S. <ole...@gm...> - 2009年05月29日 07:25:10
Hallo Theodore,
"Drain, Theodore R"
<the...@jp...> writes:
> Remember, this is not a multi-threaded system. You can't receive a
> second repaint event while the drawing code is happening because the
> event loop is not in a separate thread. 
This is not my choice. If the user resizes the window, the events are created
in that manner. 
And I cannot prevent the user from resizing the window.
Best regards
Ole
From: Ole S. <ole...@gm...> - 2009年05月29日 07:24:44
Hi again,
Ole Streicher <ole...@gm...> writes:
> Darren Dale <dsd...@gm...> writes:
>> I am really busy with other things, and can't offer suggestions unless
>> you post a short, simple, standalone script that demonstrates the
>> problem.
> Sure:
> w.show()
> a.exec_()
I forgot to say: execute this code, and then try to resize the window
width with the mouse -- this leads to a wrong scrollbar width. Trying to
resize the window height with the mouse leads to a wrong scrollbar
position.
Best regards
Ole
From: Ole S. <ole...@gm...> - 2009年05月29日 07:19:19
Hi Darren,
Darren Dale <dsd...@gm...> writes:
> I am really busy with other things, and can't offer suggestions unless
> you post a short, simple, standalone script that demonstrates the
> problem.
Sure:
--------------------------------8<-----------------------------------------
import random
import sys
from PyQt4 import QtGui, QtCore
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure,SubplotParams
class DiagramWidget(QtGui.QWidget):
 def __init__(self, parent):
 QtGui.QWidget.__init__(self, parent)
 layout = QtGui.QVBoxLayout(self)
 self.setLayout(layout)
 self.diagram = InnerDiagramWidget(self)
 self.scrollbar = QtGui.QScrollBar(QtCore.Qt.Horizontal, self)
 layout.addWidget(self.diagram)
 layout.addWidget(self.scrollbar)
 def resizeEvent(self, event):
 print 'figure resize to', event.size()
 QtGui.QWidget.resizeEvent(self, event)
class InnerDiagramWidget(FigureCanvas):
 def __init__(self, parent):
 fig = Figure()
 self.axes = fig.add_subplot(111)
 range = xrange(10000)
 l = [ random.randint(-5, 5) for i in range ]
 self.axes.plot(range, l, drawstyle='steps')
 FigureCanvas.__init__(self, fig)
 self.setParent(parent)
 FigureCanvas.setSizePolicy(self,
 QtGui.QSizePolicy.Expanding,
 QtGui.QSizePolicy.Expanding)
 FigureCanvas.updateGeometry(self)
 def resizeEvent(self, event):
 print 'scroll resize to', event.size()
 FigureCanvas.resizeEvent(self, event)
a = QtGui.QApplication(sys.argv)
w = QtGui.QMainWindow()
w.setCentralWidget(DiagramWidget(w))
w.show()
a.exec_()
--------------------------------8<-----------------------------------------
To see the problem undisturbed, you may remove the "resizeEvent()"
functions.
Best regards
Ole
Hi Darren,
On Fri, May 29, 2009 at 01:50, Darren Dale <dsd...@gm...> wrote:
> On Thu, May 28, 2009 at 6:01 PM, Sandro Tosi <mo...@de...> wrote:
>>
>> Hi Darren,
>>
>> On Thu, May 28, 2009 at 19:16, Darren Dale <dsd...@gm...> wrote:
>> > Try the attached script.
>>
>> Oh it works very great! thanks you very much!
>>
>> One thing I've done is also remove
>>
>> import matplotlib
>> matplotlib.use('Qt4Agg')
>>
>> since we're already importing the qt4agg backend directly right after.
>>
>> One only thing it's left a bit obscure (also because doc is a little
>> missing) is this piece of code:
>>
>>    # update the data
>>    self.line.set_ydata(np.sin(self.x+self.cnt/10.0))
>>    # just draw the animated artist
>>    self.ax.draw_artist(self.line)
>>    # just redraw the axes rectangle
>>    self.blit(self.ax.bbox)
>>
>> first, I've not clear wat draw_artist and blit does, so if you can
>> shine some light on me :)
>>
>> Secondly, the "effect" I'd like to achieve is to update the current
>> line values and "replace" the current line with a new one. In this
>> code, instead, the line is plotted keeping the previous instances
>> around. So the effect is to fil the canvas with sin function plots
>> instead of updating only one instance.
>>
>> Do you know how to "fix" this?
>
> Not off the top of my head. Maybe someone else on the list can offer a
> suggestion.
Thanks a lot for your help! Early morning coding did help! :)
I'm attaching a script to do what I wanted to. The solution was to
remove the animated=True when calling self.ax.plot and then call an
explicit self.fig.canvas.draw() - and here it is an animate sin and
cos function! :)
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
On Thu, May 28, 2009 at 6:01 PM, Sandro Tosi <mo...@de...> wrote:
> Hi Darren,
>
> On Thu, May 28, 2009 at 19:16, Darren Dale <dsd...@gm...> wrote:
> > Try the attached script.
>
> Oh it works very great! thanks you very much!
>
> One thing I've done is also remove
>
> import matplotlib
> matplotlib.use('Qt4Agg')
>
> since we're already importing the qt4agg backend directly right after.
>
> One only thing it's left a bit obscure (also because doc is a little
> missing) is this piece of code:
>
> # update the data
> self.line.set_ydata(np.sin(self.x+self.cnt/10.0))
> # just draw the animated artist
> self.ax.draw_artist(self.line)
> # just redraw the axes rectangle
> self.blit(self.ax.bbox)
>
> first, I've not clear wat draw_artist and blit does, so if you can
> shine some light on me :)
>
> Secondly, the "effect" I'd like to achieve is to update the current
> line values and "replace" the current line with a new one. In this
> code, instead, the line is plotted keeping the previous instances
> around. So the effect is to fil the canvas with sin function plots
> instead of updating only one instance.
>
> Do you know how to "fix" this?
>
Not off the top of my head. Maybe someone else on the list can offer a
suggestion.
Darren
Hi Darren,
On Thu, May 28, 2009 at 19:16, Darren Dale <dsd...@gm...> wrote:
> Try the attached script.
Oh it works very great! thanks you very much!
One thing I've done is also remove
import matplotlib
matplotlib.use('Qt4Agg')
since we're already importing the qt4agg backend directly right after.
One only thing it's left a bit obscure (also because doc is a little
missing) is this piece of code:
 # update the data
 self.line.set_ydata(np.sin(self.x+self.cnt/10.0))
 # just draw the animated artist
 self.ax.draw_artist(self.line)
 # just redraw the axes rectangle
 self.blit(self.ax.bbox)
first, I've not clear wat draw_artist and blit does, so if you can
shine some light on me :)
Secondly, the "effect" I'd like to achieve is to update the current
line values and "replace" the current line with a new one. In this
code, instead, the line is plotted keeping the previous instances
around. So the effect is to fil the canvas with sin function plots
instead of updating only one instance.
Do you know how to "fix" this?
Thanks a lot for your support! :)
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Michael D. <md...@st...> - 2009年05月28日 17:47:29
The name of the Computer Modern Roman font that ships with matplotlib is 
"cmr10", so
 mpl.rc('font', family = 'serif', serif = 'cmr10')
should work.
Mike
Nicolas Pourcelot wrote:
> Hi,
>
> is there any way to use Computer Modern in any text in matplotlib ?
>
> In http://matplotlib.sourceforge.net/users/customizing.html, I read 
> the following :
>
> #font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
> #font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
> #font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, cursive
> #font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy
> #font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
> 
> So, Computer Modern is not listed there.
>
> However, Computer Modern is used in mathtext, so I suppose there is a 
> way to use it also in plain text, but I can't figure it...
>
> I tried :
> /mpl.rc('font', family = 'serif', serif = 'computer modern roman')/
> but it did not work.
>
> Thanks a lot,
>
> Nicolas P.
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Michael D. <md...@st...> - 2009年05月28日 17:45:32
Nicolas Pourcelot wrote:
> Thanks for your answer.
>
>
> Michael Droettboom a écrit :
>> Handling this like an accent is trivial, and handled with the patch 
>> below (which I will commit to SVN).
> It is however not so much useful, since \vec does already the job.
The rightarrow is longer than vec. Much more suitable for multiple 
letters underneath.
>
>> Handling this in such a way that the length of the arrow changes 
>> based on the size of the underlying text is less straightforward and 
>> will take some time to implement.
> This is what I meant, yes.
> Hope you will success, I miss it quite a lot for now.
I'll get to this when I have the time.
Cheers,
Mike
>
>> Cheers,
>> Mike
>>
>> Index: lib/matplotlib/mathtext.py
>> ===================================================================
>> --- lib/matplotlib/mathtext.py (revision 7148)
>> +++ lib/matplotlib/mathtext.py (working copy)
>> @@ -2445,7 +2445,9 @@
>> r"'" : r'\combiningacuteaccent',
>> r'~' : r'\combiningtilde',
>> r'.' : r'\combiningdotabove',
>> - r'^' : r'\circumflexaccent'
>> + r'^' : r'\circumflexaccent',
>> + r'overrightarrow' : r'\rightarrow',
>> + r'overleftarrow' : r'\leftarrow'
>> }
>>
>> _wide_accents = set(r"widehat widetilde".split())
>>
>> Nicolas Pourcelot wrote:
>>> Hi,
>>>
>>> is there any way to display a big arrow on a vector using mathtext, 
>>> like "$\overrightarrow{AB}$" ?
>>>
>>> If not, is there any plan to implement it in a next release ?
>>>
>>> Thanks a lot,
>>>
>>> Nicolas P.
>>>
>>> ------------------------------------------------------------------------------ 
>>>
>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>>> is a gathering of tech-side developers & brand creativity 
>>> professionals. Meet
>>> the minds behind Google Creative Lab, Visual Complexity, Processing, 
>>> & iPhoneDevCamp as they present alongside digital heavyweights like 
>>> Barbarian Group, R/GA, & Big Spaceship. 
>>> http://p.sf.net/sfu/creativitycat-com 
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>>
From: Nicolas P. <nic...@gm...> - 2009年05月28日 17:33:36
Thanks for your answer.
Michael Droettboom a écrit :
> Handling this like an accent is trivial, and handled with the patch 
> below (which I will commit to SVN).
It is however not so much useful, since \vec does already the job.
> Handling this in such a way that the length of the arrow changes based 
> on the size of the underlying text is less straightforward and will 
> take some time to implement.
This is what I meant, yes.
Hope you will success, I miss it quite a lot for now.
Thanks again,
Nicolas
> Cheers,
> Mike
>
> Index: lib/matplotlib/mathtext.py
> ===================================================================
> --- lib/matplotlib/mathtext.py (revision 7148)
> +++ lib/matplotlib/mathtext.py (working copy)
> @@ -2445,7 +2445,9 @@
> r"'" : r'\combiningacuteaccent',
> r'~' : r'\combiningtilde',
> r'.' : r'\combiningdotabove',
> - r'^' : r'\circumflexaccent'
> + r'^' : r'\circumflexaccent',
> + r'overrightarrow' : r'\rightarrow',
> + r'overleftarrow' : r'\leftarrow'
> }
>
> _wide_accents = set(r"widehat widetilde".split())
>
> Nicolas Pourcelot wrote:
>> Hi,
>>
>> is there any way to display a big arrow on a vector using mathtext, 
>> like "$\overrightarrow{AB}$" ?
>>
>> If not, is there any plan to implement it in a next release ?
>>
>> Thanks a lot,
>>
>> Nicolas P.
>>
>> ------------------------------------------------------------------------------ 
>>
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>> is a gathering of tech-side developers & brand creativity 
>> professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, 
>> & iPhoneDevCamp as they present alongside digital heavyweights like 
>> Barbarian Group, R/GA, & Big Spaceship. 
>> http://p.sf.net/sfu/creativitycat-com 
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>
Hi Sandro,
On Wed, May 27, 2009 at 7:14 PM, Sandro Tosi <mo...@de...> wrote:
> Hi Darren,
> thanks for replying
>
> On Wed, May 27, 2009 at 21:01, Darren Dale <dsd...@gm...> wrote:
> > On Wed, May 27, 2009 at 9:11 AM, Sandro Tosi <mo...@de...> wrote:
> >>
> >> Hi all,
> >> I'd like to adapt 'animation_blit_qt4.py' to a pure OO approach,
> >> removing pylab from the code and move to something near to
> >> 'embedding_in_qt4.py'.
> >>
> >> I tried a bit but failed miserably :(
> >>
> >> What I'd like to achieve is use something like in
> >> 'embedding_in_qt4.py' but that can be updated using the timerEvent /
> >> startTime paradigm (something similar to gobject.add_idle(func) but
> >> this time for Qt4).
> >>
> >> Can someone please give me a help on this?
> >
> > Can you be more specific? Maybe post what you have along with a
> description
> > of how it is failing?
>
> Eheh, sorry for being so generic: I wrote that email from work, while
> the code I've worked on was at home ;)
>
> So, the situation is this:
>
> - animation_blit_qt4.py has a nice way to update the graph "online",
> using the timerEvent/startTimer
> - animation_blit_qt4.py contains pylab staff (I want to avoid using)
> - animation_blit_qt4.py uses the backend Qt4Agg not the backend object
> - embedding_in_qt4.py uses an OO approach at embedding mpl in a qt4
> widget/application.
>
> The ultimate result I want to achieve is to embed mpl in a qt4
> application but update the graph in realtime.
>
> So I started modifying animation_blit_qt4.py to make it "more OO" :)
>
> The attached script "animation_blit_qt4_morph.py" only replaced the
> pylab parts with a mix of OO style and pyplot, and the timerEvent just
> print the receive event without updating the graph.
>
> As you can see, not much of what I need :(
>
> What I'd like to achive is something similar to
> "embedding_in_qt4_morph.py" but where the graph is updated
> automatically like in an animation.
>
> Your help will be appreciated a lot :)
>
Try the attached script.
Darren
From: Zorg 4. <zor...@gm...> - 2009年05月28日 17:14:34
Oh, removing .matplotlib/matplotlibrc solved this issue.
The content of matplotlibrc was really simple, though:
--
font.size : 8.0
#
# The figure subplot parameters. All dimensions are fraction of the
# figure width or height
#
#figure.subplot.left : 0.125 # the left side of the subplots of the figure
#figure.subplot.right : 0.9 # the right side of the subplots of the figure
#figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure
#figure.subplot.top : 0.9 # the top of the subplots of the figure
#figure.subplot.wspace : 0.2 # the amount of width reserved for
blank space between subplots
#figure.subplot.hspace : 0.2 # the amount of height reserved for
white space between subplots
figure.subplot.hspace : 0.3 # the amount of height reserved for
white space between subplots
--
Regards
From: Michael D. <md...@st...> - 2009年05月28日 16:48:53
Handling this like an accent is trivial, and handled with the patch 
below (which I will commit to SVN).
Handling this in such a way that the length of the arrow changes based 
on the size of the underlying text is less straightforward and will take 
some time to implement.
Cheers,
Mike
Index: lib/matplotlib/mathtext.py
===================================================================
--- lib/matplotlib/mathtext.py (revision 7148)
+++ lib/matplotlib/mathtext.py (working copy)
@@ -2445,7 +2445,9 @@
 r"'" : r'\combiningacuteaccent',
 r'~' : r'\combiningtilde',
 r'.' : r'\combiningdotabove',
- r'^' : r'\circumflexaccent'
+ r'^' : r'\circumflexaccent',
+ r'overrightarrow' : r'\rightarrow',
+ r'overleftarrow' : r'\leftarrow'
 }
 
 _wide_accents = set(r"widehat widetilde".split())
Nicolas Pourcelot wrote:
> Hi,
>
> is there any way to display a big arrow on a vector using mathtext, like 
> "$\overrightarrow{AB}$" ?
>
> If not, is there any plan to implement it in a next release ?
>
> Thanks a lot,
>
> Nicolas P.
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Drain, T. R <the...@jp...> - 2009年05月28日 16:21:51
Ole wrote:
My interpretation of this is:
- the FigureCanvas gets the first resize event and repaints itself (*)
- during the repaint it gets the second resize event
- since it is already in the repaint process, the second request
 is ignored (or queued) and returns immediately
- this leads to the processing of the second resize for the scrollbar
- after the first repaint (*) is finished, the first resize of the
 scrollbar is started
Remember, this is not a multi-threaded system. You can't receive a second repaint event while the drawing code is happening because the event loop is not in a separate thread. You can make calls that will put a repaint event on the X event queue. When the resize code is finished, the event queue will then be processed in the order they were received. I'd guess that something in your repaint/drawing code is changing the size of the widgets which is probably should not be doing.
From: Darren Dale [mailto:dsd...@gm...]
Sent: Thursday, May 28, 2009 8:57 AM
To: Ole Streicher
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Strange resize behaviour for qt backend
On Thu, May 28, 2009 at 7:55 AM, Ole Streicher <ole...@gm...<mailto:ole...@gm...>> wrote:
Hi again,
is there no idea on this topic? Does the update work for you as it
should?
I am really busy with other things, and can't offer suggestions unless you post a short, simple, standalone script that demonstrates the problem.
Darren
I started to debugging it a bit by adding debug output to the
moveEvent()/resizeEvent() functions. I seems that the resizeEvents
(resp. moveEvents) come out of order. The following comes when one
resizes the window width:
figure resize to PyQt4.QtCore.QSize(803, 474) <-- first event
figure resize to PyQt4.QtCore.QSize(879, 474) <-- second event
scroll resize to PyQt4.QtCore.QSize(879, 15) <-- second event (wrong!!)
scroll resize to PyQt4.QtCore.QSize(803, 15) <-- first event
My interpretation of this is:
- the FigureCanvas gets the first resize event and repaints itself (*)
- during the repaint it gets the second resize event
- since it is already in the repaint process, the second request
 is ignored (or queued) and returns immediately
- this leads to the processing of the second resize for the scrollbar
- after the first repaint (*) is finished, the first resize of the
 scrollbar is started
Who should be blamed for that? Is it
- Qt since they dont distribute the events in the order of occurrence to
 the layout childs?
- or FigureCanvas since it returns from the secons call while the first
 one is not finished yet?
How can I workaround this?
Best regards,
Ole
Ole Streicher <ole...@gm...<mailto:ole...@gm...>> writes:
> Hi,
>
> I am using matplotlib for some data vizualization. To ensure a
> consistent user interface among the whole application, I do the
> scrolling/zooming stuff myself. So, for a diagram, a horizontal
> scrollbar is displayed below the diagram that enabled to shift along the
> x axis. This is (part of) the code:
>
> ------------------------8<-----------------------------------------------
> from PyQt4 import QtGui, QtCore
> from matplotlib.figure import Figure,SubplotParams
>
> class DiagramWidget(QtGui.QWidget):
> def __init__(self, parent):
> QtGui.QWidget.__init__(self, parent)
> layout = QtGui.QVBoxLayout(self)
> self.diagram = InnerDiagramWidget(self)
> self.scrollbar = QtGui.QScrollBar(QtCore.Qt.Horizontal, self)
> self.connect(self.scrollbar, QtCore.SIGNAL('valueChanged(int)'),
> self.diagram.scroll_event)
> layout.addWidget(self.diagram)
> layout.addWidget(self.scrollbar)
> # ...
>
> class InnerDiagramWidget(FigureCanvas):
> def __init__(self, parent):
> fig = Figure(facecolor = 'w',
> subplotpars = SubplotParams(left = 0.08, right=0.96,
> bottom = 0.1, top=0.98))
> self.axes = fig.add_subplot(111)
> FigureCanvas.__init__(self, fig)
> FigureCanvas.setParent(self, parent)
> FigureCanvas.setSizePolicy(self,
> QtGui.QSizePolicy.Expanding,
> QtGui.QSizePolicy.Expanding)
> FigureCanvas.updateGeometry(self)
>
> def scroll_event(self, x):
> pass # here is real code ofcourse
> # ...
> ------------------------8<-----------------------------------------------
>
> However, when I put this DiagramWidget into a window and try to resize
> it vertically by mouse (with some data ... about 4000 points), the
> scrollbar is not alwas shown correctly.
>
> One can see that the diagram widget size does not change with every mouse
> move, and the scrollbar sometimes goes out of the visible window, where
> it is unusable.
>
> The similar occurres in the horizontal direction: sometimes the
> scrollbar gets not updated properly. This is the case when the Figure
> canvas takes a long time for update.
>
> If I put the scrollbar on top of the widget, everything is fine, except
> that is the wrong place for a scrollbar :-)
>
> Is this a bug in FigureCanvas, in Qt or in my code? How can I debug and
> solve this?
>
> Best regards
>
> Ole
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Matplotlib-users mailing list
Mat...@li...<mailto:Mat...@li...>
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
"In our description of nature, the purpose is not to disclose the real essence of the phenomena but only to track down, so far as it is possible, relations between the manifold aspects of our experience" - Niels Bohr
"It is a bad habit of physicists to take their most successful abstractions to be real properties of our world." - N. David Mermin
"Once we have granted that any physical theory is essentially only a model for the world of experience, we must renounce all hope of finding anything like the correct theory ... simply because the totality of experience is never accessible to us." - Hugh Everett III
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.43/2138 - Release Date: 05/27/09 18:21:00
From: Nicolas P. <nic...@gm...> - 2009年05月28日 16:04:36
Hi,
is there any way to use Computer Modern in any text in matplotlib ?
In http://matplotlib.sourceforge.net/users/customizing.html, I read the 
following :
#font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, cursive
#font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy
#font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
So, Computer Modern is not listed there.
However, Computer Modern is used in mathtext, so I suppose there is a 
way to use it also in plain text, but I can't figure it...
I tried :
/mpl.rc('font', family = 'serif', serif = 'computer modern roman')/
but it did not work.
Thanks a lot,
Nicolas P.
From: Darren D. <dsd...@gm...> - 2009年05月28日 15:56:39
On Thu, May 28, 2009 at 7:55 AM, Ole Streicher <ole...@gm...>wrote:
> Hi again,
>
> is there no idea on this topic? Does the update work for you as it
> should?
>
I am really busy with other things, and can't offer suggestions unless you
post a short, simple, standalone script that demonstrates the problem.
Darren
>
> I started to debugging it a bit by adding debug output to the
> moveEvent()/resizeEvent() functions. I seems that the resizeEvents
> (resp. moveEvents) come out of order. The following comes when one
> resizes the window width:
>
> figure resize to PyQt4.QtCore.QSize(803, 474) <-- first event
> figure resize to PyQt4.QtCore.QSize(879, 474) <-- second event
> scroll resize to PyQt4.QtCore.QSize(879, 15) <-- second event (wrong!!)
> scroll resize to PyQt4.QtCore.QSize(803, 15) <-- first event
>
> My interpretation of this is:
> - the FigureCanvas gets the first resize event and repaints itself (*)
> - during the repaint it gets the second resize event
> - since it is already in the repaint process, the second request
> is ignored (or queued) and returns immediately
> - this leads to the processing of the second resize for the scrollbar
> - after the first repaint (*) is finished, the first resize of the
> scrollbar is started
>
> Who should be blamed for that? Is it
> - Qt since they dont distribute the events in the order of occurrence to
> the layout childs?
> - or FigureCanvas since it returns from the secons call while the first
> one is not finished yet?
>
> How can I workaround this?
>
> Best regards,
>
> Ole
>
> Ole Streicher <ole...@gm...> writes:
> > Hi,
> >
> > I am using matplotlib for some data vizualization. To ensure a
> > consistent user interface among the whole application, I do the
> > scrolling/zooming stuff myself. So, for a diagram, a horizontal
> > scrollbar is displayed below the diagram that enabled to shift along the
> > x axis. This is (part of) the code:
> >
> > ------------------------8<-----------------------------------------------
> > from PyQt4 import QtGui, QtCore
> > from matplotlib.figure import Figure,SubplotParams
> >
> > class DiagramWidget(QtGui.QWidget):
> > def __init__(self, parent):
> > QtGui.QWidget.__init__(self, parent)
> > layout = QtGui.QVBoxLayout(self)
> > self.diagram = InnerDiagramWidget(self)
> > self.scrollbar = QtGui.QScrollBar(QtCore.Qt.Horizontal, self)
> > self.connect(self.scrollbar, QtCore.SIGNAL('valueChanged(int)'),
> > self.diagram.scroll_event)
> > layout.addWidget(self.diagram)
> > layout.addWidget(self.scrollbar)
> > # ...
> >
> > class InnerDiagramWidget(FigureCanvas):
> > def __init__(self, parent):
> > fig = Figure(facecolor = 'w',
> > subplotpars = SubplotParams(left = 0.08, right=0.96,
> > bottom = 0.1, top=0.98))
> > self.axes = fig.add_subplot(111)
> > FigureCanvas.__init__(self, fig)
> > FigureCanvas.setParent(self, parent)
> > FigureCanvas.setSizePolicy(self,
> > QtGui.QSizePolicy.Expanding,
> > QtGui.QSizePolicy.Expanding)
> > FigureCanvas.updateGeometry(self)
> >
> > def scroll_event(self, x):
> > pass # here is real code ofcourse
> > # ...
> > ------------------------8<-----------------------------------------------
> >
> > However, when I put this DiagramWidget into a window and try to resize
> > it vertically by mouse (with some data ... about 4000 points), the
> > scrollbar is not alwas shown correctly.
> >
> > One can see that the diagram widget size does not change with every mouse
> > move, and the scrollbar sometimes goes out of the visible window, where
> > it is unusable.
> >
> > The similar occurres in the horizontal direction: sometimes the
> > scrollbar gets not updated properly. This is the case when the Figure
> > canvas takes a long time for update.
> >
> > If I put the scrollbar on top of the widget, everything is fine, except
> > that is the wrong place for a scrollbar :-)
> >
> > Is this a bug in FigureCanvas, in Qt or in my code? How can I debug and
> > solve this?
> >
> > Best regards
> >
> > Ole
> >
> >
> >
> ------------------------------------------------------------------------------
> > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> > is a gathering of tech-side developers & brand creativity professionals.
> Meet
> > the minds behind Google Creative Lab, Visual Complexity, Processing, &
> > iPhoneDevCamp as they present alongside digital heavyweights like
> Barbarian
> > Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals.
> Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
"In our description of nature, the purpose is not to disclose the real
essence of the phenomena but only to track down, so far as it is possible,
relations between the manifold aspects of our experience" - Niels Bohr
"It is a bad habit of physicists to take their most successful abstractions
to be real properties of our world." - N. David Mermin
"Once we have granted that any physical theory is essentially only a model
for the world of experience, we must renounce all hope of finding anything
like the correct theory ... simply because the totality of experience is
never accessible to us." - Hugh Everett III
From: Ole S. <ole...@gm...> - 2009年05月28日 11:55:32
Hi again,
is there no idea on this topic? Does the update work for you as it
should?
I started to debugging it a bit by adding debug output to the
moveEvent()/resizeEvent() functions. I seems that the resizeEvents
(resp. moveEvents) come out of order. The following comes when one
resizes the window width:
figure resize to PyQt4.QtCore.QSize(803, 474) <-- first event
figure resize to PyQt4.QtCore.QSize(879, 474) <-- second event
scroll resize to PyQt4.QtCore.QSize(879, 15) <-- second event (wrong!!)
scroll resize to PyQt4.QtCore.QSize(803, 15) <-- first event
My interpretation of this is:
- the FigureCanvas gets the first resize event and repaints itself (*)
- during the repaint it gets the second resize event
- since it is already in the repaint process, the second request
 is ignored (or queued) and returns immediately
- this leads to the processing of the second resize for the scrollbar
- after the first repaint (*) is finished, the first resize of the 
 scrollbar is started
Who should be blamed for that? Is it
- Qt since they dont distribute the events in the order of occurrence to
 the layout childs?
- or FigureCanvas since it returns from the secons call while the first
 one is not finished yet?
How can I workaround this?
Best regards,
Ole
Ole Streicher <ole...@gm...> writes:
> Hi,
>
> I am using matplotlib for some data vizualization. To ensure a
> consistent user interface among the whole application, I do the
> scrolling/zooming stuff myself. So, for a diagram, a horizontal
> scrollbar is displayed below the diagram that enabled to shift along the
> x axis. This is (part of) the code:
>
> ------------------------8<-----------------------------------------------
> from PyQt4 import QtGui, QtCore
> from matplotlib.figure import Figure,SubplotParams
>
> class DiagramWidget(QtGui.QWidget):
> def __init__(self, parent):
> QtGui.QWidget.__init__(self, parent)
> layout = QtGui.QVBoxLayout(self)
> self.diagram = InnerDiagramWidget(self)
> self.scrollbar = QtGui.QScrollBar(QtCore.Qt.Horizontal, self)
> self.connect(self.scrollbar, QtCore.SIGNAL('valueChanged(int)'),
> self.diagram.scroll_event)
> layout.addWidget(self.diagram)
> layout.addWidget(self.scrollbar)
> # ...
>
> class InnerDiagramWidget(FigureCanvas):
> def __init__(self, parent):
> fig = Figure(facecolor = 'w', 
> subplotpars = SubplotParams(left = 0.08, right=0.96, 
> bottom = 0.1, top=0.98))
> self.axes = fig.add_subplot(111)
> FigureCanvas.__init__(self, fig)
> FigureCanvas.setParent(self, parent)
> FigureCanvas.setSizePolicy(self,
> QtGui.QSizePolicy.Expanding,
> QtGui.QSizePolicy.Expanding)
> FigureCanvas.updateGeometry(self)
>
> def scroll_event(self, x):
> pass # here is real code ofcourse
> # ...
> ------------------------8<-----------------------------------------------
>
> However, when I put this DiagramWidget into a window and try to resize
> it vertically by mouse (with some data ... about 4000 points), the
> scrollbar is not alwas shown correctly.
>
> One can see that the diagram widget size does not change with every mouse
> move, and the scrollbar sometimes goes out of the visible window, where
> it is unusable.
>
> The similar occurres in the horizontal direction: sometimes the
> scrollbar gets not updated properly. This is the case when the Figure
> canvas takes a long time for update.
>
> If I put the scrollbar on top of the widget, everything is fine, except
> that is the wrong place for a scrollbar :-)
>
> Is this a bug in FigureCanvas, in Qt or in my code? How can I debug and
> solve this?
>
> Best regards
>
> Ole
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
From: Nicolas P. <nic...@gm...> - 2009年05月28日 10:33:52
Hi,
is there any way to display a big arrow on a vector using mathtext, like 
"$\overrightarrow{AB}$" ?
If not, is there any plan to implement it in a next release ?
Thanks a lot,
Nicolas P.
From: Stefanie L. <lu...@ip...> - 2009年05月28日 09:44:05
Hi Chris:
Thanks for your answer!
I try the printing_in_wx.py with Python 2.5, MPlot 0.8 and wxPython 2.8.7.1. 
and its just crashes after I want to print or preview (unfortunately without 
any error message) and closes Python.
Here's an example of my program:
# -*- coding: latin1 -*-
import sys
import os
import wx
import wx.lib.scrolledpanel as SP
from wx.lib.mixins.listctrl import CheckListCtrlMixin
import wx.lib.mixins.listctrl as listmix
import pylab
from matplotlib.backends.backend_wx import FigureCanvasWx
from matplotlib.font_manager import fontManager, FontProperties
class CheckListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
 def __init__(self, parent, nr):
 wx.ListCtrl.__init__(self, parent, -1, size=(900, ((nr*8)+50)), 
style=wx.LC_REPORT|wx.LC_VRULES|wx.LC_HRULES)
 listmix.ListCtrlAutoWidthMixin.__init__(self)
class MyFrame(wx.Frame, listmix.ColumnSorterMixin):
 def __init__(self):
 wx.Frame.__init__(self, None, -1, "Results", size=(300, 300))
 self.panel = SP.ScrolledPanel(self, -1)
 self.panel.SetBackgroundColour('WHITE')
 d = {1:('test','22')}
 nr = 1
 self.list = CheckListCtrl(self.panel, nr)
 self.list.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL))
 self.b = wx.Button(self.panel, 10, "Copy to clipboard")
 self.b.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
 self.Bind(wx.EVT_BUTTON, self.to_clipboard, self.b)
 l1 = wx.StaticText(self.panel, -1, "RNAi Scan Results")
 l1.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.NORMAL))
 dummy = wx.StaticText(self.panel, -1, "")
 self.fig = pylab.figure(figsize=(10,8))
 self.fig.subplots_adjust(hspace = 0.5, left=0.07, right=0.95, 
top=0.93)
 self.canvas = FigureCanvasWx(self.panel, -1, self.fig)
 self.vbox = wx.BoxSizer(wx.VERTICAL)
 sizer = wx.GridBagSizer(hgap = 10, vgap = 10)
 sizer.Add(l1, pos = (0, 1), flag = wx.ALIGN_CENTER)
 sizer.Add(self.list, pos = (1, 1), span = (2,1), flag = 
wx.EXPAND|wx.GROW|wx.ALIGN_CENTER)
 sizer.Add(self.b, pos = (1, 2))
 sizer.Add(self.canvas, pos = (3, 1), flag = 
wx.EXPAND|wx.GROW|wx.ALIGN_CENTER)
 sizer.Add(dummy, pos = (4, 1), flag = 
wx.EXPAND|wx.GROW|wx.ALIGN_CENTER)
 self.vbox.Add(sizer, 1, wx.ALL|wx.ALIGN_CENTER,10)
 self.panel.SetSizer(self.vbox)
 self.panel.SetAutoLayout(1)
 self.panel.SetupScrolling()
 self.list.InsertColumn(0, "ID")
 self.list.InsertColumn(1, "All Hits")
 self.list.InsertColumn(2, "Efficient Hits")
 for key, data in d.iteritems():
 index = self.list.InsertStringItem(sys.maxint, data[0])
 self.list.SetStringItem(index, 1, data[1])
 self.list.SetItemData(index, key)
 self.list.SetColumnWidth(0, 200)
 self.list.SetColumnWidth(1, 100)
 self.list.SetColumnWidth(2, 150)
 self.Show()
 self.ShowFullScreen(True, style = wx.FULLSCREEN_NOMENUBAR)
 self.Build_Menus()
 self.plot_data(self.fig)
 def Build_Menus(self):
 """ build menus """
 MENU_EXIT = wx.NewId()
 MENU_SAVE = wx.NewId()
 MENU_PRINT = wx.NewId()
 MENU_PSETUP= wx.NewId()
 MENU_PREVIEW=wx.NewId()
 MENU_CLIPB =wx.NewId()
 MENU_HELP =wx.NewId()
 menuBar = wx.MenuBar()
 f0 = wx.Menu()
 f0.Append(MENU_SAVE, "&Export", "Save Image of Plot")
 f0.AppendSeparator()
 f0.Append(MENU_PSETUP, "Page Setup...", "Printer Setup")
 f0.Append(MENU_PREVIEW,"Print Preview...", "Print Preview")
 f0.Append(MENU_PRINT, "&Print", "Print Plot")
 f0.AppendSeparator()
 f0.Append(MENU_EXIT, "E&xit", "Exit")
 menuBar.Append(f0, "&File");
 f1 = wx.Menu()
 f1.Append(MENU_HELP, "Quick Reference", "Quick Reference")
 menuBar.Append(f1, "&Help");
 self.SetMenuBar(menuBar)
 self.Bind(wx.EVT_MENU, self.onPrint, id=MENU_PRINT)
 self.Bind(wx.EVT_MENU, self.onPrinterSetup, id=MENU_PSETUP)
 self.Bind(wx.EVT_MENU, self.onPrinterPreview, id=MENU_PREVIEW)
 self.Bind(wx.EVT_MENU, self.save, id=MENU_SAVE)
 self.Bind(wx.EVT_MENU, self.onExit , id=MENU_EXIT)
 self.Bind(wx.EVT_MENU, self.onHelp, id=MENU_HELP)
 def onPrinterSetup(self,event=None):
 self.canvas.Printer_Setup(event=event)
 def onPrinterPreview(self,event=None):
 self.canvas.Printer_Preview(event=event)
 def onPrint(self,event=None):
 self.canvas.Printer_Print(event=event)
 def onHelp(self, event=None):
 pass
 def onExit(self,event=None):
 self.Destroy()
 def save(self, event):
 pass
 def to_clipboard(self, evt):
 f = open("data_hits.txt", "r")
 msg = 'Id' + '\t' + 'All Hits' + '\t' 'Eff Hits' + '\n' + f.read()
 f.close()
 data = wx.TextDataObject()
 data.SetText(msg)
 if wx.TheClipboard.Open():
 wx.TheClipboard.SetData(data)
 wx.TheClipboard.Flush()
 wx.TheClipboard.Close()
 def plot_data(self, figure):
 query_plot = figure.add_subplot(1, 1, 1)
 listex = [0,1,2,3]
 listey = [0,1,2,3]
 query_plot.plot(listex,listey)
if __name__ == '__main__':
 app = wx.PySimpleApp()
 frame = MyFrame()
 frame.Show(True)
 app.MainLoop()
----- Original Message ----- 
From: "Christopher Barker" <Chr...@no...>
To: "matplotlib-users" <mat...@li...>
Sent: Wednesday, May 27, 2009 6:28 PM
Subject: Re: [Matplotlib-users] Printing in wx
Stefanie Lück wrote:
> I'm trying to print my plots in a wxScrolledPanel under Windows XP but
> it dosen't work. I only can print / preview the start of the plot on the
> left upper site, the rest of page is empty:
I wonder if that has to do with how you are using the scolledpanel, and
DCs. Post a sample (as a as-small-as-possible-running-app, if you can),
and we can take a look.
> I used printing according the example of matplotlib printing_in_wx.py.
> BTW if I want to run this demo, Python crashes.
it works fine for me on OS-X
What messages to you get with your crash? What versions of Python,
wxPython and MPL are you running?
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. 
Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Pellegrini E. <eri...@ya...> - 2009年05月28日 08:45:28
Dear all,
When writing:
f = figure()
...
gl = f.gca().get_xgridlines()
I always get a list of gridlines independantly of the fact that they are 
actually drawn or not.
Is there an attribute or a method that could inform me whether the 
gridlines are actually displayed or not ?
I thougt that the method "get_visible" could do the job but it seems to 
do an unrelated task.
thank you very much
Eric
 
From: pellegrini <pel...@il...> - 2009年05月28日 08:43:51
Dear all,
When writing:
f = figure()
...
gl = f.gca().get_xgridlines()
I always get a list of gridlines independantly of the fact that they are 
actually drawn or not.
Is there an attribute or a method that could inform me whether the 
gridlines are actually displayed or not ?
I thougt that the method "get_visible" could do the job but it seems to 
do an unrelated task.
thank you very much
Eric
22 messages has been excluded from this view by a project administrator.

Showing results of 523

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