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




Showing results of 383

<< < 1 .. 8 9 10 11 12 .. 16 > >> (Page 10 of 16)
From: Sandro T. <mat...@gm...> - 2009年06月10日 11:30:12
Hi Jothy,
first of all, please do not use -announce mailing list, that is for...
announcement. There is matplotlib-users for users support request like
this one (move the discussion there).
On Wed, Jun 10, 2009 at 11:08, KS Jothy<jot...@gm...> wrote:
> Hi,
>
> I am getting a strange error while platting a graph in the matplotlib widget
> embedded in a PyQt form.
>
> Initially the axis labels range from 0.0 to 1.0, then after plotting these
> labels fail to disappear, it appears along with the new ticklabels.
>
> Please see the attached screenshot
could you please post a short example (ideally the smallest part able)
to reproduce the problem?
Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Ole S. <ole...@gm...> - 2009年06月10日 11:23:12
Hi Mathias,
Matthias Michler <Mat...@gm...> writes:
> you can reset the ydata using:
> ydata = myline.get_ydata()
> ydata += 50
> myline.set_ydata(ydata) # pass new data to line object
> Does this work for you?
Yes. Altough I dont understand why I have to set it again (the ydata
still belong to the curve)
Thanks,
Ole
From: Wellenreuther, G. <ger...@de...> - 2009年06月10日 11:05:14
Dear all,
just noticed that the problem also happens with the raw_input - I guess 
I just closed the figure-windows during the raw_input-call. Closing the 
figures (either manually or with pylab.close()) prevents the crash, but 
I wonder why? Memory should not be an issue, python crashes when only 
using 100MB.
Cheers, Gerd
Wellenreuther, Gerd wrote:
> Dear all,
> 
> I just again faced a problem appearing whenever I quickly generate 
> multiple plots (using Windows XP, Python 2.5, matplotlib 0.98.1):
> 
>> pylab.ion()
>> for n in range(n_elements):
>> ## print
>> ## print element_symbols[n]+'-'+element_linegroup[n]
>> ## print normalized_mass_fractions[:,:,n]
>> pylab.figure()
>> ## pylab.imshow(normalized_mass_fractions[:,:,n])
>> pylab.pcolor(normalized_mass_fractions[:,:,n])
>> pylab.title(element_symbols[n]+'-'+element_linegroup[n])
>> pylab.draw()
>> ## raw_input()
>>
> 
> My script crashes if and only if I do not have a raw_input at the end, 
> windows points towards:
> 
> AppName: pythonw.exe	 AppVer: 0.0.0.0	 ModName: tk84.dll
> ModVer: 8.4.2.12	 Offset: 0000bddf
> 
> Most probably I am just abusing python/pylab, or maybe this is a known 
> issue?
> 
> Cheers, Gerd
From: Ole S. <ole...@gm...> - 2009年06月10日 10:30:17
Hi,
I want to change the value of a line in an axes. What I tried is
myline = axes.plot(...)
xdata, ydata = myline.get_data()
for i in range(ydata.__len__()):
 ydata[i] += 50
to shift all y values up by 50.
But I dont see the change I made, even after a show(). How can I force
the diagram to show the changed value?
Regards
Ole
From: Wellenreuther, G. <ger...@de...> - 2009年06月10日 10:23:05
Dear all,
I just again faced a problem appearing whenever I quickly generate 
multiple plots (using Windows XP, Python 2.5, matplotlib 0.98.1):
> 
> pylab.ion()
> for n in range(n_elements):
> ## print
> ## print element_symbols[n]+'-'+element_linegroup[n]
> ## print normalized_mass_fractions[:,:,n]
> pylab.figure()
> ## pylab.imshow(normalized_mass_fractions[:,:,n])
> pylab.pcolor(normalized_mass_fractions[:,:,n])
> pylab.title(element_symbols[n]+'-'+element_linegroup[n])
> pylab.draw()
> ## raw_input()
> 
My script crashes if and only if I do not have a raw_input at the end, 
windows points towards:
AppName: pythonw.exe	 AppVer: 0.0.0.0	 ModName: tk84.dll
ModVer: 8.4.2.12	 Offset: 0000bddf
Most probably I am just abusing python/pylab, or maybe this is a known 
issue?
Cheers, Gerd
-- 
Dr. Gerd Wellenreuther
beamline scientist P06 "Hard X-Ray Microprobe/Nanoprobe"
Petra III project
HASYLAB at DESY
Notkestr. 85
22603 Hamburg
Tel.: + 49 40 8998 5701
From: Paul A. L. <pau...@gm...> - 2009年06月10日 06:59:28
> On 9. juni. 2009, at 17.18, Jouni K. Seppänen wrote:
>
>> Chaitanya Krishna <ic...@gm...> writes:
>>
>>> On Tue, Jun 9, 2009 at 12:05 PM, Paul Anton Letnes <pau...@gm... 
>>> > wrote:
>>>>
>>>> When I run the script below, the xlabel and ylabel do not show 
>>>> up. If I
>>>> increase the figure size, it all works fine.
>>>
>>> I am not sure if it is a bug. But, it is usual that such a thing
>>> happens when you are making small figures (like in your case).
>>
>> Arguably it is a bug, since it is reasonable to expect that when 
>> you set
>> an xlabel or ylabel (or, say, large yticklabels), it shows up in the
>> figure. There are at least two problems to solve here: what should 
>> the
>> user interface be like, and how can it best be implemented?
>>
>> The user interface question seems difficult to me. If you set the 
>> figure
>> size to something small (as in this case) and then add labels, should
>> matplotlib reduce the area available for the plot? Or should it 
>> reduce
>> the font size of the labels and the tick labels, and perhaps the 
>> amount
>> of white space between the axes and the labels? Or some combination 
>> of
>> these?
>>
>> The implementation question could also be somewhat hairy, since the
>> bounding box of text objects depends on the backend. If agg and pdf
>> disagree on the size of a label, is it OK to get different-looking
>> results in png and pdf?
>>
>> -- 
>> Jouni K. Seppänen
>> http://www.iki.fi/jks
>>
>>
>> ------------------------------------------------------------------------------
>> Crystal Reports - New Free Runtime and 30 Day Trial
>> Check out the new simplified licensing option that enables unlimited
>> royalty-free distribution of the report engine for externally facing
>> server and web deployment.
>> http://p.sf.net/sfu/businessobjects
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> This _must_ be a bug. Consider the following:
> ##############
> import matplotlib
> matplotlib.rcParams['figure.figsize'] = [8.85, 3.20]
> matplotlib.use('pdf')
> from pylab import *
>
> xs = linspace(0, 2 * pi)
> ys = sin(xs)
> plot(xs, ys)
> xlabel(r'$T_{est}$')
> ylabel('y axis')
>
> savefig('test')
> ##############
> Here, the vertical size is clearly large enough for a label, as it 
> is a full inch larger than in the previous example. However, the 
> xlabel is truncated. This _must_ be a bug. When I make a plot, I 
> would expect that all parts of the plot appear on the plot.
>
> As an example, in Gnuplot, the text just appears in the "right 
> place", but is too large (overlaps the plot, etc). Hence, you see 
> for yourself that the font size is the problem.
>
> Anyway, it can't be the font size here, as the xlabel was completely 
> outside the "bounding box" (I'm not sure of the terminology). To me, 
> it just looks like a problem with the scaling - the plot looks 
> perfectly OK in Illustrator, disregarding that it doesn't fit inside 
> the "viewing window".
>
> I'm not an expert, and I certainly don't know how to fix this. But I 
> do know that other software manages this nicely. Don't get me wrong, 
> I use matplotlib because I like it - but it should be possible to 
> fix this problem.
>
>
> Best regards,
> Paul.
From: Paul A. L. <pau...@gm...> - 2009年06月10日 06:52:45
Attachments: test.pdf
On 9. juni. 2009, at 17.18, Jouni K. Seppänen wrote:
> Chaitanya Krishna <ic...@gm...> writes:
>
>> On Tue, Jun 9, 2009 at 12:05 PM, Paul Anton Letnes <pau...@gm... 
>> > wrote:
>>>
>>> When I run the script below, the xlabel and ylabel do not show up. 
>>> If I
>>> increase the figure size, it all works fine.
>>
>> I am not sure if it is a bug. But, it is usual that such a thing
>> happens when you are making small figures (like in your case).
>
> Arguably it is a bug, since it is reasonable to expect that when you 
> set
> an xlabel or ylabel (or, say, large yticklabels), it shows up in the
> figure. There are at least two problems to solve here: what should the
> user interface be like, and how can it best be implemented?
>
> The user interface question seems difficult to me. If you set the 
> figure
> size to something small (as in this case) and then add labels, should
> matplotlib reduce the area available for the plot? Or should it reduce
> the font size of the labels and the tick labels, and perhaps the 
> amount
> of white space between the axes and the labels? Or some combination of
> these?
>
> The implementation question could also be somewhat hairy, since the
> bounding box of text objects depends on the backend. If agg and pdf
> disagree on the size of a label, is it OK to get different-looking
> results in png and pdf?
>
> -- 
> Jouni K. Seppänen
> http://www.iki.fi/jks
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
This _must_ be a bug. Consider the following:
##############
import matplotlib
matplotlib.rcParams['figure.figsize'] = [8.85, 3.20]
matplotlib.use('pdf')
from pylab import *
xs = linspace(0, 2 * pi)
ys = sin(xs)
plot(xs, ys)
xlabel(r'$T_{est}$')
ylabel('y axis')
savefig('test')
##############
Here, the vertical size is clearly large enough for a label, as it is 
a full inch larger than in the previous example. However, the xlabel 
is truncated. This _must_ be a bug. When I make a plot, I would expect 
that all parts of the plot appear on the plot.
As an example, in Gnuplot, the text just appears in the "right place", 
but is too large (overlaps the plot, etc). Hence, you see for yourself 
that the font size is the problem.
Anyway, it can't be the font size here, as the xlabel was completely 
outside the "bounding box" (I'm not sure of the terminology). To me, 
it just looks like a problem with the scaling - the plot looks 
perfectly OK in Illustrator, disregarding that it doesn't fit inside 
the "viewing window".
I'm not an expert, and I certainly don't know how to fix this. But I 
do know that other software manages this nicely. Don't get me wrong, I 
use matplotlib because I like it - but it should be possible to fix 
this problem.
Best regards,
Paul.
From: Jae-Joon L. <lee...@gm...> - 2009年06月10日 06:28:42
If you're using very recent version of mpl, you may try savefig with
"bbox_inches" option.
savefig("a.png", bbox_inches="tight")
The algorithm is not perfect, but will work for most of simple plots.
Regards,
-JJ
On Tue, Jun 9, 2009 at 1:22 PM, Nils Wagner<nw...@ia...> wrote:
> Hi all,
>
> I am looking for an autocrop function.
>
> It should remove borders from an image.
> Is it available in matplotlib ?
>
> Any pointer would be appreciated.
>
> Thanks in advance
>
>                        Nils
>
>
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Steve N. <ema...@ya...> - 2009年06月10日 05:57:38
Thanks John. I hope you aren't receiving this reply twice (my email kicked me out when I hit send). I actually am importing pylab so it isn't an entirely qt app. I didn't post all of the code originally b/c it is long (and it would reveal how poor of a programmer I am :) ), but here are the relevant sections. The problematic section is in blue. Please let me know if you need anything else.
I will try the examples you suggested the next time on I'm a Windows box to see if they behave differently than in Linux. 
Thanks!
#!/usr/bin/env python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from pylab import *
from pulse_ui import Ui_MainWindow
from mpl_pyqt4_widget import MPL_Widget
class Plot_Widget(QMainWindow, Ui_MainWindow):
  
  def __init__(self, parent = None):
    QMainWindow.__init__(self)
    self.setupUi(self)
    self.label_checkmark.hide()
    self.usr_click = 1
    self.abort_run = 0
    self.R = 1.6e-19/(6.626e-34*3e8/(float(self.lineEdit_wavelength.text())*10**-9))
    self.facet_fraction = 0.5
    self.lengths = []
    self.etads = []
    self.data = loadtxt('test_data.csv',comments = '#',delimiter = ',',skiprows = 0)
    self.slider_stop.setMaximum(len(self.data))
    QObject.connect(self.plotBtn, SIGNAL("clicked()"),self.plotData)
    QObject.connect(self.pushButton_abort,SIGNAL('clicked()'),self.abort)
  def abort(self):
    self.abort_run = 1
    
  def plotSetupMain(self):
    self.plotWidget.canvas.ax.cla()
    self.plotWidget.canvas.ax.set_title("Pulsed LIV")
    self.plotWidget.canvas.ax.title.set_fontsize(10)
    self.plotWidget.canvas.ax.set_xlabel("Current (mA)", fontsize = 9)
    self.plotWidget.canvas.ax.set_ylabel("Light (mW)", fontsize = 9)
    labels_x = self.plotWidget.canvas.ax.get_xticklabels()
    labels_y = self.plotWidget.canvas.ax.get_yticklabels()
    for xlabel in labels_x:
      xlabel.set_fontsize(8)
    for ylabel in labels_y:
      ylabel.set_fontsize(8)
      ylabel.set_color('b')
    self.plotWidget.canvas.ax.grid()
  
  def plotData(self):
    self.plotSetupMain()
    self.label_checkmark.hide()
    del self.plotWidget.canvas.ax.lines[:]
   
    for i in range(0,len(self.data)):
      line, = self.plotWidget.canvas.ax.plot([self.data[i,1]], [self.data[i,0]], 'bo')
      self.plotWidget.canvas.draw()
     
      if self.abort_run == 1:
        break
    
    if self.abort_run == 0:
      self.plotWidget.canvas.ax.plot(self.data[:,1], self.data[:,0], 'bo')
      self.usr_click = 0
      self.slider_start.setValue(len(self.data)/2)
      self.usr_click = 0
      self.slider_stop.setValue(len(self.data))
      a,b = polyfit(self.data[self.slider_start.value():self.slider_stop.value(),1],self.data[self.slider_start.value():self.slider_stop.value(),0+self.acquire],1)
      fit = a*self.data[:,1] + b
      self.plotWidget.canvas.ax.plot(self.data[:,1], fit, 'g-',linewidth = '2')
      self.plotWidget.canvas.ax.axvline(self.data[self.slider_start.value()-1,1],linestyle = '--',color = 'r')
      self.plotWidget.canvas.ax.axvline(self.data[self.slider_stop.value()-1,1],linestyle = '--',color = 'k')
      self.plotWidget.canvas.draw()
      self.label_etad.setText('%.3f' % (a*self.R/self.facet_fraction))
      self.label_ith.setText('%.3f' % (-b/a) + ' mA')
      
    else:
      self.abort_run = 0
--- On Tue, 6/9/09, John Hunter <jd...@gm...> wrote:
From: John Hunter <jd...@gm...>
Subject: Re: [Matplotlib-users] MPL with PyQt: different behavior on Windows vs. Linux
To: "Steve Nicholes" <ema...@ya...>
Cc: mat...@li...
Date: Tuesday, June 9, 2009, 6:25 PM
On Tue, Jun 9, 2009 at 5:17 PM, Steve
Nicholes<ema...@ya...> wrote:
> I am writing some code for automated testing via GPIB using MPL and PyQt.
> To simulate automated data collection while debugging the program, I have
> added a for loop (see below) after reading in a data file that plots each
> point one by one. When I run the program in Linux, I see each point appear
> on the canvas one by one as designed, but when I run the same code in
> Windows, nothing shows up on the canvas during the for loop. Instead, once
> the loop has completed, all points appear simulataneously. Is there any
> reason the why calls to canvas.draw() show nothing when run in Windows? I'm
> really lost on this one and would appreciate it someone can tell me what I'm
> doing wrong. If you need more info on what I'm doing, please let me know.
It would help if we could see the whole program. Ie, I assume this is
a pure qt app with no import of pyplot/pylab, but w/o seeing any code
I cannot be sure. Also, check the qt examples at
 http://matplotlib.sourceforge.net/examples/animation/index.html
and see if they work on windows. If so, perhaps you can borrow
inspiration from them. If not, perhaps we need to do something
different for qt/windows animation.
JDH
JDH
 
From: Jouni K. S. <jk...@ik...> - 2009年06月10日 05:05:27
John Hunter <jd...@gm...> writes:
> es, this is your problem. You have the matplotlib source directory in
> your HOME directory and when you run from your home directory, it is
> being picked up instead of the installation directory. I usually name
> my src tree "mpl" to avoid this problem
I don't know why there is an empty __init__.py in the source directory,
but would something break if the file printed out a warning, like
print '''
 Warning: your "import %s" is picking up the matplotlib source
 directory, which is not usable as a Python module. To avoid this
 problem, either rename the directory to e.g. "mpl" or move it to
 some directory that is not on your Python path.
''' % __name__
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Anton V. <vas...@ya...> - 2009年06月10日 03:58:18
You're right, I haven't read your question properly... I am not sure that autocrop exists in pil. Maybe somebody with more experience can shed some light. 
Sent from my iPhone
On Jun 9, 2009, at 12:10 PM, "Nils Wagner" <nw...@ia...> wrote:
On Tue, 9 Jun 2009 11:31:19 -0700 (PDT)
Anton Vasilescu <vas...@ya...> wrote:
I wasn't able to find one in Matplotlib but you can use PIL library for all the imaging work. Really easy to use. Here is the webpage for it: http://www.pythonware.com/products/pil/index.htm
Anton
Hi Anton,
Thank you for your prompt reply.
I am aware of PIL.
However I didn't find an autocrop function within PIL.
Cheers,
 Nils
from PIL import Image
im = Image.open('test.png')
#
# Calculates the bounding box of the non-zero regions in the image.
# The bounding box is returned as a 4-tuple defining
# the left, upper, right, and lower pixel coordinate.
# If the image is completely empty, this method returns None.
#
print im.getbbox()
print im.size
#
# Returns a rectangular region from the current image.
# The box is a 4-tuple defining the left, upper, right, and lower
#
box = (100, 100, 800, 800)
region = im.crop(box)
region.show()
It would be nice to compute the box automatically.
Any idea ?
 
From: Nicholas S. <Nic...@un...> - 2009年06月10日 03:15:50
Hi all,
I am still very green when it comes to the use of matplotlib but I am 
finding the versatility and robustness of the package extremely useful 
at present. One application I am constantly using matplotlib for 
concerns a break in the axis. Although I have a script or two based on 
an original from 
http://matplotlib.sourceforge.net/examples/pylab_examples/manual_axis.html 
I am curious to put something together that automates the process for my 
own purposes. In doing this I have come across the PyX 
graph.axis.split() command. I am wondering if the simple way that pyx 
makes the break could be simply relayed in matplotlib.
The question is then: has anybody tried this before? (as to be honest I 
have a few other things to do)
From: John H. <jd...@gm...> - 2009年06月10日 01:25:43
On Tue, Jun 9, 2009 at 5:17 PM, Steve
Nicholes<ema...@ya...> wrote:
> I am writing some code for automated testing via GPIB using MPL and PyQt.
> To simulate automated data collection while debugging the program, I have
> added a for loop (see below) after reading in a data file that plots each
> point one by one. When I run the program in Linux, I see each point appear
> on the canvas one by one as designed, but when I run the same code in
> Windows, nothing shows up on the canvas during the for loop. Instead, once
> the loop has completed, all points appear simulataneously. Is there any
> reason the why calls to canvas.draw() show nothing when run in Windows? I'm
> really lost on this one and would appreciate it someone can tell me what I'm
> doing wrong. If you need more info on what I'm doing, please let me know.
It would help if we could see the whole program. Ie, I assume this is
a pure qt app with no import of pyplot/pylab, but w/o seeing any code
I cannot be sure. Also, check the qt examples at
 http://matplotlib.sourceforge.net/examples/animation/index.html
and see if they work on windows. If so, perhaps you can borrow
inspiration from them. If not, perhaps we need to do something
different for qt/windows animation.
JDH
JDH
From: Steve N. <ema...@ya...> - 2009年06月09日 22:18:18
Hi,
I am writing some code for automated testing via GPIB using MPL and PyQt. To simulate automated data collection while debugging the program, I have added a for loop (see below) after reading in a data file that plots each point one by one. When I run the program in Linux, I see each point appear on the canvas one by one as designed, but when I run the same code in Windows, nothing shows up on the canvas during the for loop. Instead, once the loop has completed, all points appear simulataneously. Is there any reason the why calls to canvas.draw() show nothing when run in Windows? I'm really lost on this one and would appreciate it someone can tell me what I'm doing wrong. If you need more info on what I'm doing, please let me know.
Thanks in advance,
Steve
self.data = loadtxt('test_data2.csv',comments = '#',delimiter = ',',skiprows = 0)
for i in range(0,len(self.data)):
      line, = self.plotWidget.canvas.ax.plot([self.data[i,1]], [self.data[i,0]], 'bo')
      self.plotWidget.canvas.draw()
 
 
From: Gökhan S. <gok...@gm...> - 2009年06月09日 21:05:58
On Tue, Jun 9, 2009 at 3:05 PM, Lou Pecora <lou...@ya...> wrote:
>
> --- On *Tue, 6/9/09, Gökhan SEVER <gok...@gm...>* wrote:
> > Modified that section as to eliminate confusions:
>
> *> NOTE:* *Experimental work has been going on to integrate 3D plotting
> functionality into matplotlib. Please see the related mplot3d
> documentation<http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/index.html?highlight=mplot3d> or
> take a look at matplotlib gallery<http://matplotlib.sourceforge.net/gallery.html> for
> example 3D plots. For a more sophisticated 3D visualization and plotting
> interface, you can try Mayavi <http://code.enthought.com/projects/mayavi/> which
> is actively maintained and features an 'mlab' interface similar to
> matplotlib's 'pylab'. *
>
>
> ---------------------------------------------------------------------------------------------
>
> It is good news that matplotlib 3D functions are being upgraded. Thank
> you.
> But it is unclear from the message whether one still must stay with 0.91
> version or the 3D functions in pylab now work with 0.98 and higher. Can you
> give us some information on that?
>
> Thanks.
>
> -- Lou Pecora, my views are my own.
>
>
>
I have thought using the word "experimental" will make the state of mplot3d
clear :) Nevertheless, you have already been answered.
GS
On Tue, Jun 9, 2009 at 3:05 PM, Lou Pecora<lou...@ya...> wrote:
> ---------------------------------------------------------------------------------------------
> It is good news that matplotlib 3D functions are being upgraded. Thank you.
> But it is unclear from the message whether one still must stay with 0.91
> version or the 3D functions in pylab now work with 0.98 and higher. Can you
> give us some information on that?
They now work in matplotlib svn in the toolkit mpl_toolkits.mplot3d,
and will be available in the next release
http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
JDH
From: John H. <jd...@gm...> - 2009年06月09日 20:06:39
On Tue, Jun 9, 2009 at 2:42 PM, Hani Nakhoul<na...@gm...> wrote:
> I'm sorry--here's the right listing:
>
> $ ls matplotlib
> agg24   examples   KNOWN_BUGS       PKG-INFO      setup.py
> build   __init__.py  lib          README.txt     src
> build.out __init__.pyc license        setup.cfg.template TODO
> CHANGELOG INSTALL    Makefile        setupegg.py     ttconv
> CXX    install.out  MANIFEST.in      setupext.py
> doc    INTERACTIVE  matplotlibrc.template setupext.pyc
>
es, this is your problem. You have the matplotlib source directory in
your HOME directory and when you run from your home directory, it is
being picked up instead of the installation directory. I usually name
my src tree "mpl" to avoid this problem
 > cd
 > mv matplotlib mpl
JDH
--- On Tue, 6/9/09, Gökhan SEVER <gok...@gm...> wrote:
> Modified that section as to eliminate confusions:
> NOTE: Experimental work has been going on to integrate 3D plotting functionality into matplotlib. Please see the related mplot3d documentation or take a look at matplotlib gallery for example 3D plots. For a more sophisticated 3D visualization and plotting interface, you can try Mayavi which is actively maintained and features an 'mlab' interface similar to matplotlib's 'pylab'. 
---------------------------------------------------------------------------------------------
It is good news that matplotlib 3D functions are being upgraded. Thank you.
But it is unclear from the message whether one still must stay with 0.91 version or the 3D functions in pylab now work with 0.98 and higher. Can you give us some information on that? 
Thanks.
-- Lou Pecora, my views are my own.
 
From: Hani N. <na...@gm...> - 2009年06月09日 19:42:17
I'm sorry--here's the right listing:
$ ls matplotlib
agg24 examples KNOWN_BUGS PKG-INFO setup.py
build __init__.py lib README.txt src
build.out __init__.pyc license setup.cfg.template TODO
CHANGELOG INSTALL Makefile setupegg.py ttconv
CXX install.out MANIFEST.in setupext.py
doc INTERACTIVE matplotlibrc.template setupext.pyc
Hani
On Tue, Jun 9, 2009 at 2:34 PM, John Hunter <jd...@gm...> wrote:
> On Tue, Jun 9, 2009 at 2:13 PM, Hani Nakhoul<na...@gm...> wrote:
> > Dear all,
> > Here is the listing:
> >
> > In [1]: import matplotlib
> >
> > In [2]: print matplotlib.__file__
> > matplotlib/__init__.pyc
> >
> > In [3]: ls -a
> > ./ .gimp-2.6/ Public/
> > ../ .gksu.lock .pulse/
> > .adobe/ .gnome2/ .pulse-cookie
> > ATLAS/ .gnome2_private/ pydstool/
> > .bash_history .gnupg/ PyDSTool/
> > .bash_logout .gstreamer-0.10/ .recently-used
> > .bashrc .gtk-bookmarks .recently-used.xbel
> > .bashrc~ .gvfs/ scipy-0.7.0b1/
> > .cache/ .hplip/ scipy_build/
> > .checkgmail/ .ICEauthority .ssh/
> > .compiz/ .icons/ .subversion/
> > .config/ .inkscape/ .sudo_as_admin_successful
> > .dbus/ .ipython/ SuiteSparse/
> > Desktop/ lapack-3.1.1/ Templates/
> > .dmrc .lftp/ .themes/
> > Documents/ .local/ .thumbnails/
> > .emacs .macromedia/ .tomboy/
> > .emacs.d/ matplotlib/ .tomboy.log
> > .esd_auth .matplotlib/ .tsclient/
> > .evolution/ .mozilla/ .update-manager-core/
> > Examples@ .mozilla-thunderbird/ .update-notifier/
> > fftw-3.2/ Music/ Videos/
> > .fontconfig/ .nautilus/ .viminfo
> > .gconf/ neuron/ .wapi/
> > .gconfd/ numpy-1.2.1/ .Xauthority
> > .geany/ .openoffice.org2/ .xsession-errors
> > .gegl-0.0/ Pictures/
> > .gftp/ .profile
>
>
>
> What I wanted was the listing of the "matplotlib" dir
>
> > ls matplotlib
>
> it looks like you have a matplotlib dir in your working directory that
> is being picked up and you probably don't want it.
>
> JDH
>
From: John H. <jd...@gm...> - 2009年06月09日 19:34:53
On Tue, Jun 9, 2009 at 2:13 PM, Hani Nakhoul<na...@gm...> wrote:
> Dear all,
> Here is the listing:
>
> In [1]: import matplotlib
>
> In [2]: print matplotlib.__file__
> matplotlib/__init__.pyc
>
> In [3]: ls -a
> ./      .gimp-2.6/     Public/
> ../      .gksu.lock     .pulse/
> .adobe/    .gnome2/       .pulse-cookie
> ATLAS/      .gnome2_private/    pydstool/
> .bash_history .gnupg/       PyDSTool/
> .bash_logout  .gstreamer-0.10/    .recently-used
> .bashrc    .gtk-bookmarks     .recently-used.xbel
> .bashrc~    .gvfs/       scipy-0.7.0b1/
> .cache/    .hplip/       scipy_build/
> .checkgmail/  .ICEauthority     .ssh/
> .compiz/    .icons/       .subversion/
> .config/    .inkscape/     .sudo_as_admin_successful
> .dbus/      .ipython/     SuiteSparse/
> Desktop/    lapack-3.1.1/     Templates/
> .dmrc      .lftp/       .themes/
> Documents/   .local/       .thumbnails/
> .emacs      .macromedia/     .tomboy/
> .emacs.d/   matplotlib/     .tomboy.log
> .esd_auth   .matplotlib/     .tsclient/
> .evolution/  .mozilla/     .update-manager-core/
> Examples@   .mozilla-thunderbird/ .update-notifier/
> fftw-3.2/   Music/       Videos/
> .fontconfig/  .nautilus/     .viminfo
> .gconf/    neuron/       .wapi/
> .gconfd/    numpy-1.2.1/     .Xauthority
> .geany/    .openoffice.org2/   .xsession-errors
> .gegl-0.0/   Pictures/
> .gftp/      .profile
What I wanted was the listing of the "matplotlib" dir
> ls matplotlib
it looks like you have a matplotlib dir in your working directory that
is being picked up and you probably don't want it.
JDH
From: Hani N. <na...@gm...> - 2009年06月09日 19:14:42
Dear all,
Here is the listing:
In [1]: import matplotlib
In [2]: print matplotlib.__file__
matplotlib/__init__.pyc
In [3]: ls -a
./ .gimp-2.6/ Public/
../ .gksu.lock .pulse/
.adobe/ .gnome2/ .pulse-cookie
ATLAS/ .gnome2_private/ pydstool/
.bash_history .gnupg/ PyDSTool/
.bash_logout .gstreamer-0.10/ .recently-used
.bashrc .gtk-bookmarks .recently-used.xbel
.bashrc~ .gvfs/ scipy-0.7.0b1/
.cache/ .hplip/ scipy_build/
.checkgmail/ .ICEauthority .ssh/
.compiz/ .icons/ .subversion/
.config/ .inkscape/ .sudo_as_admin_successful
.dbus/ .ipython/ SuiteSparse/
Desktop/ lapack-3.1.1/ Templates/
.dmrc .lftp/ .themes/
Documents/ .local/ .thumbnails/
.emacs .macromedia/ .tomboy/
.emacs.d/ matplotlib/ .tomboy.log
.esd_auth .matplotlib/ .tsclient/
.evolution/ .mozilla/ .update-manager-core/
Examples@ .mozilla-thunderbird/ .update-notifier/
fftw-3.2/ Music/ Videos/
.fontconfig/ .nautilus/ .viminfo
.gconf/ neuron/ .wapi/
.gconfd/ numpy-1.2.1/ .Xauthority
.geany/ .openoffice.org2/ .xsession-errors
.gegl-0.0/ Pictures/
.gftp/ .profile
Hani
On Tue, Jun 9, 2009 at 10:30 AM, John Hunter <jd...@gm...> wrote:
> On Tue, Jun 9, 2009 at 10:22 AM, Hani Nakhoul<na...@gm...> wrote:
> > Dear all,
> > I'm running matplotlib 0.98.5.2 on a machine with Ubuntu Intrepid 8.10.
> It's
> > worked well for me so far, but I encounter problems running matplotlib
> when
> > trying to update the PYTHONPATH in the .bashrc file. Adding just the line
> > "export PYTHONPATH=$PYTHONPATH", for example, gives the following:
> >
> > $ ipython -pylab
> > Traceback (most recent call last):
> > File "/usr/bin/ipython", line 27, in <module>
> > IPython.Shell.start().mainloop()
> > File "/var/lib/python-support/python2.5/IPython/Shell.py", line 1219,
> in
> > start
> > shell = _select_shell(sys.argv)
> > File "/var/lib/python-support/python2.5/IPython/Shell.py", line 1188,
> in
> > _select_shell
> > backend = matplotlib.rcParams['backend']
> > AttributeError: 'module' object has no attribute 'rcParams'
>
> Most likely you are adding a directory to the path that has a
> directory named matplotlib in it (eg the matplotlib src directory)
> which is not the matplotlib install directory. Try doing
>
> >>> import matplotlib
> >>> print matplotlib.__file__
>
> when the PYTHONPATH is set to the troublesome value and then do an ls
> on the directory that is reported by the __file__ printout. Post the
> listing here and we can advise further.
>
> JDH
>
From: Nils W. <nw...@ia...> - 2009年06月09日 19:10:57
On Tue, 9 Jun 2009 11:31:19 -0700 (PDT)
 Anton Vasilescu <vas...@ya...> wrote:
> I wasn't able to find one in Matplotlib but you can use 
>PIL library for all the imaging work. Really easy to use. 
> Here is the webpage for it: 
>http://www.pythonware.com/products/pil/index.htm
> 
> Anton
> 
> 
Hi Anton,
Thank you for your prompt reply.
I am aware of PIL.
However I didn't find an autocrop function within PIL.
Cheers,
 Nils
from PIL import Image
im = Image.open('test.png')
#
# Calculates the bounding box of the non-zero regions in 
the image.
# The bounding box is returned as a 4-tuple defining
# the left, upper, right, and lower pixel coordinate.
# If the image is completely empty, this method returns 
None.
#
print im.getbbox()
print im.size
#
# Returns a rectangular region from the current image.
# The box is a 4-tuple defining the left, upper, right, 
and lower
#
box = (100, 100, 800, 800)
region = im.crop(box)
region.show()
 
It would be nice to compute the box automatically.
Any idea ?
From: Anton V. <vas...@ya...> - 2009年06月09日 18:31:26
I wasn't able to find one in Matplotlib but you can use PIL library for all the imaging work. Really easy to use. 
Here is the webpage for it: http://www.pythonware.com/products/pil/index.htm
Anton
________________________________
From: Nils Wagner <nw...@ia...>
To: mat...@li...
Sent: Tuesday, June 9, 2009 10:22:05 AM
Subject: [Matplotlib-users] autocrop function
Hi all,
I am looking for an autocrop function.
It should remove borders from an image.
Is it available in matplotlib ?
Any pointer would be appreciated.
Thanks in advance
 Nils
 
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
From: Gökhan S. <gok...@gm...> - 2009年06月09日 18:24:47
On Tue, Jun 9, 2009 at 1:00 PM, Esmail <eb...@ho...> wrote:
> Hi Gökhan,
>
>
> Gökhan SEVER wrote:
> >
> > I'll give mayavi/mlab a try, I think there was a note to the
> > effect that matplotlib quit supporting 3D plots and recommended
> > mayavi.
> >
> >
> > There is still work going on to improve matplotlib 3d plotting
> > functionality. You can see matplotlib gallery or check-out the latest
> > trunk of matplotlib and experiment with the 3d examples.
>
> Ah .. ok .. good to know. I was going by this note:
>
> NOTE: 3D plotting has been removed from matplotlib >= 0.98. You'll either
> need
> to use an older 0.91.x version or look at Mayavi which is actively
> maintained
> and features an 'mlab' interface similar to matplotlib's 'pylab'.
>
> posted here:
>
> http://www.scipy.org/Cookbook/Matplotlib
>
Modified that section as to eliminate confusions:
*NOTE:* *Experimental work has been going on to integrate 3D plotting
functionality into matplotlib*. Please see the related mplot3d
documentation<http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/index.html?highlight=mplot3d>or
take a look at matplotlib
gallery <http://matplotlib.sourceforge.net/gallery.html> for example 3D
plots. For a more sophisticated 3D visualization and plotting interface, you
can try Mayavi <http://code.enthought.com/projects/mayavi/> which is
actively maintained and features an 'mlab' interface similar to matplotlib's
'pylab'.
>
>
> > So much to learn, so little time :-)
> >
> >
> > Isn't that nice? Lifelong learning? Why are complaining? Are you not a
> > scientist or raising a kid something :)
>
> hehe .. I know it sounded like a complaint, but it's really not. I
> consider myself a lifelong student, and I love learning new things.
> I just have a big appetite :-)
>
No matter how big an appetite you have, you can only digest certain amount
of items at a time :)
Cheers for lifelong learning :)
>
> Cheers,
> Esmail
>
>
From: Esmail <eb...@ho...> - 2009年06月09日 18:00:55
Hi Gökhan,
Gökhan SEVER wrote:
> 
> I'll give mayavi/mlab a try, I think there was a note to the
> effect that matplotlib quit supporting 3D plots and recommended
> mayavi.
> 
> 
> There is still work going on to improve matplotlib 3d plotting 
> functionality. You can see matplotlib gallery or check-out the latest 
> trunk of matplotlib and experiment with the 3d examples.
Ah .. ok .. good to know. I was going by this note:
NOTE: 3D plotting has been removed from matplotlib >= 0.98. You'll either need 
to use an older 0.91.x version or look at Mayavi which is actively maintained 
and features an 'mlab' interface similar to matplotlib's 'pylab'.
posted here:
http://www.scipy.org/Cookbook/Matplotlib
> So much to learn, so little time :-)
> 
> 
> Isn't that nice? Lifelong learning? Why are complaining? Are you not a 
> scientist or raising a kid something :)
hehe .. I know it sounded like a complaint, but it's really not. I
consider myself a lifelong student, and I love learning new things.
I just have a big appetite :-)
Cheers,
Esmail
8 messages has been excluded from this view by a project administrator.

Showing results of 383

<< < 1 .. 8 9 10 11 12 .. 16 > >> (Page 10 of 16)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /