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

Showing 7 results of 7

From: John H. <jdh...@ac...> - 2004年04月16日 22:42:45
>>>>> "Jim" == Jim Benson <jb...@se...> writes:
 Jim> Hi,
 Jim> I seem to be seeing some extra debug output. I have been
 Jim> using the wx background and the embedding_in_wx.py example as
 Jim> a template for how to make matplotlib plots in an app i'm
 Jim> writing. This part works great!! I am however seeing what
 Jim> appears to be a debug flag left on somewhere?
No, this is in the wx code. I traced it to the line
 wxInitAllImageHandlers()
Miraculously, I commented this out, got rid of the annoying messages,
and fixed the wx exception swallowing bug! Jeremy and I have been
killing ourselves for about 6 months trying to figure out why backend
wx was swallowing our exceptions, and I can't really convey how happy
I am to have found this. We have tried all manner of hacks, google
searches and plantive pleas to get our exceptions back to no avail.
It made debugging wx virtually impossible.
Please test this change on your system. win32 users, I would also be
much obliged if you could try commenting this out on your system to
see if you lose functionality. On my linux box, the figures came up
as expected, I was able to print to jpg and png, so all looks well.
Note, wxagg is in CVS if you need some of the agg features that native
wx drawing does not provide. But it looks like all systems are go for
a release next week so you may as well wait.
JDH
From: John H. <jdh...@ac...> - 2004年04月16日 22:21:49
>>>>> "Srinath" == Srinath Avadhanula <sr...@fa...> writes:
 Srinath> Hello all! I just recently downloaded Matplotlib and
 Srinath> love it so far :)
Thanks!
 Srinath> A hopefully quick question. In all the demo examples, the
 Srinath> navigation bar has buttons for incremental +/- zoom in
 Srinath> the X/Y directions, but no way to directly choose a
 Srinath> rectange within the figure window to zoom to like in
 Srinath> matlab. It gets very tedious the way it is if a lot of
 Srinath> zooming and panning is involved.
 Srinath> I found that I could draw a rectange in the axes and
 Srinath> update its coordinates on an motion_notify_event. The
 Srinath> problem is I do not know how to link the
 Srinath> event.get_pointer() coordinates to the coordinates within
 Srinath> the axes. Therefore I cannot set the coordinates of the
 Srinath> rectangle correctly. The following code which is slightly
 Srinath> modified from embed_gtk2.py demonstrates what I am trying
 Srinath> to do...
Yes, this would be a very nive feature. When you implement it, please
send it back to the list. Here is an example that shows you how to
connect to the events and more importantly for you, convert to user
coords
"""
An example of how to interact with the plotting canvas by connecting
to move and click events
"""
from matplotlib.matlab import *
t = arange(0.0, 1.0, 0.01)
s = sin(2*pi*t)
ax = subplot(111)
ax.plot(t,s)
canvas = get_current_fig_manager().canvas
def on_move(widget, event):
 # get the x and y coords, flip y from top to bottom
 height = canvas.figure.bbox.y.interval()
 x, y = event.x, height-event.y
 if ax.in_axes(x, y):
 # transData transforms data coords to display coords. Use the
 # inverse method to transform back
 t = ax.xaxis.transData.inverse_positions(x)
 val = ax.yaxis.transData.inverse_positions(y)
 print t, val
def on_click(widget, event):
 # get the x and y coords, flip y from top to bottom
 height = canvas.figure.bbox.y.interval()
 x, y = event.x, height-event.y
 if event.button==1:
 if ax.in_axes(x, y):
 # transData transforms data coords to display coords. Use the
 # inverse method to transform back
 t = ax.xaxis.transData.inverse_positions(x)
 val = ax.yaxis.transData.inverse_positions(y)
 
 print t, val
#canvas.connect('motion_notify_event', on_move)
canvas.connect('button_press_event', on_click)
show()
From: Srinath A. <sr...@fa...> - 2004年04月16日 22:16:49
Hello all!
I just recently downloaded Matplotlib and love it so far :)
A hopefully quick question. In all the demo examples, the navigation bar
has buttons for incremental +/- zoom in the X/Y directions, but no way
to directly choose a rectange within the figure window to zoom to like
in matlab. It gets very tedious the way it is if a lot of zooming and
panning is involved.
I found that I could draw a rectange in the axes and update its
coordinates on an motion_notify_event. The problem is I do not know how
to link the event.get_pointer() coordinates to the coordinates within
the axes. Therefore I cannot set the coordinates of the rectangle
correctly. The following code which is slightly modified from
embed_gtk2.py demonstrates what I am trying to do...
Thanks,
-- 
Srinath
from matplotlib.numerix import arange, sin, cos, pi
import matplotlib
matplotlib.use('GTK')
from matplotlib.backends.backend_gtk import FigureCanvasGTK
from matplotlib.axes import Subplot
from matplotlib.figure import Figure
import gtk
class MyApp:
 def __init__(self):
 self.win = gtk.Window()
 self.win.set_name("Embedding in GTK")
 self.win.connect("destroy", gtk.mainquit)
 self.win.set_border_width(5)
 self.vbox = gtk.VBox(spacing=3)
 self.win.add(self.vbox)
 self.vbox.show()
 self.fig = Figure(figsize=(5,4), dpi=100)
 self.ax = Subplot(self.fig, 111)
 self.recth = 0.2
 self.ylast = 0
 x = [0,0.5,0.5,0,0]
 y = [0,0,self.recth,self.recth,0]
 t = [0,1]
 r = [0,1]
 self.h = self.ax.plot(x,y,t,r)
 self.fig.add_axis(self.ax)
 self.canvas = FigureCanvasGTK(self.fig) # a gtk.DrawingArea
 self.canvas.show()
 self.canvas.connect('motion_notify_event', self.findClick)
 self.vbox.pack_start(self.canvas)
 self.win.show()
 def findClick(self, widget, event):
 ynow = event.get_coords()[1]
 if ynow < self.ylast:
 self.recth += 0.01
 elif ynow > self.ylast:
 self.recth -= 0.01
 self.h[0].set_ydata([0,0,self.recth,self.recth,0])
 self.ylast = ynow
 self.canvas.draw()
if __name__=='__main__':
 app = MyApp()
 gtk.mainloop()
From: Jim B. <jb...@se...> - 2004年04月16日 17:13:48
Hi,
 I seem to be seeing some extra debug output. I have been using
the wx background and the embedding_in_wx.py example as a template
for how to make matplotlib plots in an app i'm writing.
This part works great!! I am however seeing what appears to be
a debug flag left on somewhere?
Here is my test script:
 
(test.py)
import matplotlib
matplotlib.use('WX')
from matplotlib.backends.backend_wx import Toolbar, FigureCanvasWx,\
 FigureManager
#from matplotlib.figure import Figure
#from matplotlib.axes import Subplot
#import matplotlib.numerix as numpy
#from wxPython.wx import *
if __name__ == '__main__':
 print 'Hi There'
This works:
>>> import test
>>>
This gives me:
clavius:/home/jbenson/python>python test.py
[Debug] 10:07:56 AM: Adding duplicate image handler for 'PNG file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'JPEG file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'TIFF file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'GIF file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'PNM file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'PCX file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'XPM file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'Windows icon 
file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'Windows cursor 
file'
[Debug] 10:07:56 AM: Adding duplicate image handler for 'Windows animated 
cursor file'
Hi There
clavius:/home/jbenson/python>
I'm using matplotlib-0.52
Is this comming from matplotlib? Is there a flag i should turn off?
Thanks,
Jim
From: John H. <jdh...@ac...> - 2004年04月16日 16:51:17
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@fi...> writes:
 Flavio> Jeremy, how can I set axes limits on a figure embedded in
 Flavio> WX? I am plotting with
 Flavio> a = self.figmgr.add_subplot(111) a.plot(x,y)
 Flavio> just like in your example.
 Flavio> I would like to do someting like:
 Flavio> axis([0,10,0,10])
There is no axis command in the OO interface (though is would be easy
to add..). You can always go to matlab.py and see how it is
interacting with the gca instance. If you use your 'a' instance
everywhere it uses gca(), you can duplicate it's functionality.
 Flavio> set(gca(),'xticklabels',[]) set(gca(),'yticklabels',[])
 Flavio> set(gca(),'xticks',[]) set(gca(),'yticks',[])
the syntax of set is
 set(object or sequence, somestring, attribute)
if called with an object, set calls
 object.set_somestring(attribute)
if called with a sequence, set does
 for object in sequence:
 object.set_somestring(attribute)
So for your example, gca() is an object, so 
 a.set_xticklabels([])
 a.set_yticklabels([])
 a.set_xticks([])
 a.set_yticks([])
You may want to take another look at the tutorial section "Controlling
axes properties" which gives examples of both the matlab and OO
methods
To replicate axis, do
 a.set_xlim((xmin, xmax))
 a.set_ylim((ymin, ymax))
Should help!
JDH
From: Philippe S. <phi...@pr...> - 2004年04月16日 06:39:06
waouw thanks, that's an amazing support!
----- Original Message ----- 
From: "John Hunter" <jdh...@ac...>
To: "Philippe Strauss" <phi...@pr...>
Cc: <Mat...@li...>
Sent: Friday, April 16, 2004 3:49 AM
Subject: Re: [Matplotlib-users] setting grid density
> >>>>> "Philippe" == Philippe Strauss <phi...@pr...> writes:
>
> Philippe> This one is 1h per minor grid and tick, 6h per majors.
>
> Hi Phillipe,
>
> I just wanted to let you know that I've finished adding the major and
> minor tick support for the next release of matplotlib. There is
> additional support for plotting dates and formatting dates with major
> and minor ticks. There are specialized tick locators for marking
> ticks by minute, hour, day, weekday, month, year, every 4 hours, every
> 3 months, and so on. There is a new command plot_date function and a
> series of date converters to let you plot dates with, for example,
> epochs, python datetimes or mx.Datetimes. You can work with custom
> date instances by supplying a custom converter. You can format the
> date ticks with strftime strings of your choice.
>
> The major and minor tick support is generic and fully customizable and
> should be useful for many other applications.
>
> Look for the release next week.
>
> JDH
From: John H. <jdh...@ac...> - 2004年04月16日 02:12:03
>>>>> "Philippe" == Philippe Strauss <phi...@pr...> writes:
 Philippe> This one is 1h per minor grid and tick, 6h per majors.
Hi Phillipe,
I just wanted to let you know that I've finished adding the major and
minor tick support for the next release of matplotlib. There is
additional support for plotting dates and formatting dates with major
and minor ticks. There are specialized tick locators for marking
ticks by minute, hour, day, weekday, month, year, every 4 hours, every
3 months, and so on. There is a new command plot_date function and a
series of date converters to let you plot dates with, for example,
epochs, python datetimes or mx.Datetimes. You can work with custom
date instances by supplying a custom converter. You can format the
date ticks with strftime strings of your choice.
The major and minor tick support is generic and fully customizable and
should be useful for many other applications.
Look for the release next week.
JDH
3 messages has been excluded from this view by a project administrator.

Showing 7 results of 7

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