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) |
|
|
From: Kenneth M. <kmm...@wi...> - 2004-04-20 06:51:52
|
Couldn't see the answers to these questions when looking through the class reference docs, but they seem like common tasks, so I suspect there are standard idiomatic way of doing these. Could anyone refer me to examples showing 1) How to most easily label the x axis for data which is plotted by date? (More specifically; does matplotlib have any understanding of date values, and if so, how do I access and use it?) I'm hoping there's an easier way than explicitly labelling ticks on the x axis. 2) I'll be drawing logy graphs, and I want a certain slope to indicate a certain rate of growth, which means that, when using matplotlib via TkAgg, I want it to keep the ratio of the graph display height and display width constant as it resizes the graph to take into account changes in the size of the enclosing window. Is there a standard way to do this? Thanks, Ken McDonald |
|
From: Kenneth M. <kmm...@wi...> - 2004-04-20 05:33:34
|
Well, I finally have matplotlib up and running under OS X, and am amazed at the quality of the graphs. I'm writing up a summary of what I learned about Python/Tk/OS X, and will post it to this and other lists in the next day or two. Now, a real quick question; are there any tutorials or examples which show the "correct" way of using matplotlibs pythonic (as opposed to Matlabic) API? I don't know and don't want to learn Matlab, so figure I might as well start by using the "pure" python API. However, all of the examples I've looked at use the Matlab style interface, and the reference docs don't really give a good idea of _how_ the various Python classes are intended to be used together. Thanks, Ken |
|
From: Srinath A. <sr...@fa...> - 2004-04-19 23:09:37
|
On Mon, 19 Apr 2004, John Hunter wrote: > >>>>> "Srinath" == Srinath Avadhanula <sr...@fa...> writes: > > Srinath> Hello, I seem to have uncovered a bug in setting/updating > Srinath> the axis limits. > > limits, you get negative display coords which are undefined. I am not > sure this case is common enough to warrant the performance hit of > detecting it and doing the linear interpolation necessary to add I have no time right now to go into a technical discussion, but IMHO this is a serious enough bug that it needs to be fixed. One can only worry about performance after doing the right thing. It doesn't make sense to give the completely wrong answer in a shorter time. [Sorry, I do not mean to sound curt or rude. Excuse me if it sounds that way.] Besides whether or not its a common enough situation is very application specific. I was planning to use matplotlib to display a complex layout. At the original scale, not much can be seen. There necessarily has to be a lot of scaling to see the details. > If you have some ideas on what is the best way to handle this case, > let me know. Could you let me know which files in matplotlib have the code in question? I'll take a look then. Srinath |
|
From: John H. <jdh...@ac...> - 2004-04-19 22:34:07
|
>>>>> "Steve" == Steve Chaplin <ste...@ya...> writes:
Steve> John, When panning the viewport through a plot shouldn't
Steve> the panning stop and ignore your request when you reach the
Steve> start or end of the plot. Is there a benefit to being able
Steve> to pan off the edge of a plot?
I like to see the data scroll past the end so I know I am truly at the
end. If nothing happens, I might think the mouse click didn't work,
the program froze, or something like that. Putting the question back
on you, is there a significant cost to doing it the way it is? Most
users don't continue panning where there is no data, I assume. It's
kind of in line with the python philosophy: we're all adults here; if
you want to pan through empty space that's your decision.
JDH
|
|
From: John H. <jdh...@ac...> - 2004-04-19 22:29:26
|
>>>>> "Srinath" == Srinath Avadhanula <sr...@fa...> writes:
Srinath> Hello, I seem to have uncovered a bug in setting/updating
Srinath> the axis limits.
Hi, I have looked into this and it is indeed a bug. Here is what is
going on: The transforms for x and y take your view limits and map
them to display coords, where negative numbers don't make sense. It
is a standard linear transformation
scale = displayInterval/viewInterval
return scale*(y-viewMin) + displayMin
In your example, if the y axis view limits are [0.516, 0.52] and the
display interval is [44.0, 360.0], then transformation of the y vector
[0, 1].
scale = (360-44)/0.004
ytransformed = scale*(y-.516) + 44
which is [-40720., 38280.]
Ie, when your nearest data point is much smaller than your view
limits, you get negative display coords which are undefined. I am not
sure this case is common enough to warrant the performance hit of
detecting it and doing the linear interpolation necessary to add
pseudo data points to make your plot well defined. Simply replacing
the negative data with 0 is incorrect because you have to do linear
interpolation to get the right location in display coords. Perhaps a
warning if min(xtransformed)<0 or min(ytransformed)<0 would be
appropriate and worth the performance hit.
If you have some ideas on what is the best way to handle this case,
let me know.
JDH
|
|
From: Steve C. <ste...@ya...> - 2004-04-18 13:24:00
|
John, When panning the viewport through a plot shouldn't the panning stop and ignore your request when you reach the start or end of the plot. Is there a benefit to being able to pan off the edge of a plot? Regards, Steve |
|
From: Srinath A. <sr...@fa...> - 2004-04-18 02:37:56
|
Hello,
I seem to have uncovered a bug in setting/updating the axis limits.
If you run the following example, you should see a straight line between
(0,0) and (1,1). Pressing the "Test Zoom" button should reset the axis
limits to the values depicted below. Basically, the X axis is clipped
between [0.1,0.8] and the Y axis limits are either [0.516,0.517] or
[0.5166,0.5167] depending on which of the two lines in the code below is
commented. The following bug(s) are seen:
1. In the first case, where the y axis limit is updated to
[0.516,0.517], the line should be seen as a sharply vertical line
passing starting from x=0.516 and continuing sharply upwards till
x=0.517. However, the line seems to start significantly _after_
x=0.52.
2. In the second case, if the ylim variable is changed to
[0.5166,0.5167], then the line completely dissapears from the axes
view. It seems to fall off the right edge (is my guess), whereas it
should be seen as a more or less vertical line passing through
x=0.5166.
The test code is appended below the signature.
Thanks,
Srinath
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.ax.plot([0,1], [0,1])
self.fig.add_axis(self.ax)
self.canvas = FigureCanvasGTK(self.fig) # a gtk.DrawingArea
self.canvas.show()
self.vbox.pack_start(self.canvas)
buttonTestZoom = gtk.Button('Test Zoom')
buttonTestZoom.connect('button_press_event', self.TestZoom)
buttonTestZoom.show()
self.vbox.pack_start(buttonTestZoom)
self.win.show()
def TestZoom(self, widget, event):
self.ax.update_viewlim()
xlim = [0.1, 0.8]
# this makes the line dissapear from the axes.
#ylim = [0.5166, 0.5167]
# this shows the line but in the wrong location!
ylim = [0.516, 0.517]
self.ax.set_xlim(xlim)
self.ax.set_ylim(ylim)
self.canvas.draw()
if __name__=='__main__':
app = MyApp()
gtk.mainloop()
|
|
From: Srinath A. <sr...@fa...> - 2004-04-17 08:22:22
|
On Fri, 16 Apr 2004, John Hunter wrote:
> 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
>
Here's a very preliminary implementation. Its not really very elegant,
but it seems to work. A couple of questions. Is there a remove_line or
equivalent for axes? As of now, I make the rectangle which shows the
zoom window dissapear by setting its xdata and ydata to [], but it might
be elegant to just remove the line from the axis completely. Also I seem
to trigger a matplotlib bug if I toggle the zoom button and then start
the button press event outside the axes.
I have yet to delve into the matplotlib source itself and maybe I am not
the best person to do it. The best place to add this would be to extend
the axes class with a .zoom() method which would work like the
ZoomButtonPressed() function below (It basically makes the next button
press trigger the ZoomStart() function which in turn calls
ZoomContinue() on the "motion_notify_event"). ZoomStart() will have to
be modified to account for more than one axes belonging to a figure.
We'll have to check whether the user presses the mouse in the axes whos
.zoom() function has been called.
Thanks again for all the help :) I think I am almost ready to get things
working with matplotlib.
--
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.ax.plot([0,1], [0,1])
self.fig.add_axis(self.ax)
self.canvas = FigureCanvasGTK(self.fig) # a gtk.DrawingArea
self.canvas.show()
self.canvas.connect('motion_notify_event', self.setAxisCursorLocation)
self.vbox.pack_start(self.canvas)
buttonZoom = gtk.ToggleButton('Toggle Zoom')
buttonZoom.connect('button_press_event', self.ZoomButtonPressed)
buttonZoom.show()
self.vbox.pack_start(buttonZoom)
self.win.show()
def setAxisCursorLocation(self, widget, event):
height = self.canvas.figure.bbox.y.interval()
x, y = event.x, height-event.y
t = self.ax.xaxis.transData.inverse_positions(x)
val = self.ax.yaxis.transData.inverse_positions(y)
self.cursorLocation = (t, val)
def getAxisCursorLocation(self):
if not hasattr(self, 'cursorLocation'):
return None
return self.cursorLocation
def ZoomButtonPressed(self, widget, event):
if not widget.get_active():
self.zoomStartEventHandle = self.canvas.connect('button_press_event', self.ZoomStart)
else:
if hasattr(self, 'zoomStartEventHandle'):
self.canvas.disconnect(self.zoomStartEventHandle)
def ZoomStart(self, widget, event):
self.zoomStartPosition = self.getAxisCursorLocation()
x, y = self.zoomStartPosition
if hasattr(self, 'zoomRectangle'):
self.zoomRectangle.set_xdata([x,x,x,x,x])
self.zoomRectangle.set_ydata([y,y,y,y,y])
else:
self.zoomRectangle = self.ax.plot([x,x,x,x,x], [y,y,y,y,y], 'k:')[0]
self.zoomContinueEventHandle = self.canvas.connect_after('motion_notify_event', self.ZoomContinue)
self.zoomStopEventHandle = self.canvas.connect('button_release_event', self.ZoomStop)
def ZoomContinue(self, widget, event):
xs, ys = self.zoomStartPosition
x, y = self.getAxisCursorLocation()
self.zoomRectangle.set_xdata([xs, x, x, xs, xs])
self.zoomRectangle.set_ydata([ys, ys, y, y, ys])
self.canvas.draw()
def ZoomStop(self, widget, event):
self.canvas.disconnect(self.zoomContinueEventHandle)
self.canvas.disconnect(self.zoomStopEventHandle)
self.zoomRectangle.set_xdata([])
self.zoomRectangle.set_ydata([])
xs, ys = self.zoomStartPosition
x, y = self.getAxisCursorLocation()
self.ax.set_xlim([min([xs,x]), max([xs,x])])
self.ax.set_ylim([min([ys,y]), max([ys,y])])
self.canvas.draw()
if __name__=='__main__':
app = MyApp()
gtk.mainloop()
|
|
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
|
|
From: Peter G. <pgr...@ge...> - 2004-04-15 21:54:58
|
> > VTK, including the Python API, does Delaunay triangulation, and I've > used it to do what you're talking about. IIRC, there are other > Delaunay triangulation codes with Python bindings around. However, > the Matlab function is a little more complicated; they use > interpolation in addition to a straight Delaunay triangulation, and > it often produces nice-looking results. They cite a reference in > either the help file or the .m file; one can presumably read the > reference and re-implement it for use in Python. > > FYI, here's some relevant Python VTK code: > > profile = vtkPolyData() > profile.SetPoints(points) > > delny = vtk.vtkDelaunay2D() > delny.SetInput(profile) > delny.SetTolerance(0.01) > delny.BoundingTriangulationOff() > > normals = vtk.vtkPolyDataNormals() > normals.SetInput(delny.GetOutput()) > > lo,hi = zrange > elevation = vtk.vtkElevationFilter() > elevation.SetInput(delny.GetOutput()) > elevation.SetLowPoint(0, 0, lo) > elevation.SetHighPoint(0, 0, hi) > elevation.SetScalarRange(lo, hi) > elevation.ReleaseDataFlagOn() > > delMesh = vtk.vtkPolyDataMapper() > delMesh.SetInput(elevation.GetOutput()) > delMesh.SetLookupTable(lutLand) # doesn't work > delActor = vtk.vtkActor() > delActor.SetMapper(delMesh) > ren1.AddActor( delActor ) Thanks Andrew. I have tried octave with the octive-forge extensions. In fact I have tried two different versions with three different versions of octave-forge. All seem to be broken in one way or another. I get random segmentation faults here and there on data that other times gets processed properly. Their implementation of griddata gives me some areas (triangles) which are empty even though MATLAB produces nice plots - perhaps some convergence issue. In any case I tried using octave's griddata and plot the result using matplotlib's pcolor. If not for the empty triangles (due to griddata) the plots are precisely what I need. I will look into VTK and see what it can do. Peter |
|
From: Andrew S. <str...@as...> - 2004-04-14 20:44:32
|
On Apr 14, 2004, at 11:37 AM, Peter Groszkowski wrote: > Hello Everyone: > > Before I reinvent the wheel, I'd thought I'd ask: > > I have a set of x,y points in a plane, and to each a corresponding z. > They are spread out in circular concentric orbits. > I need to do a flat surface plot (via pcolor) of these z values. A > simple algorithm would be: > > #get data for x, y, z.. this would be some fixed points x,y inside > #a box -4<=x<=4 and -4<=y<=4 with a z value for each. > > #Create a grid > xi=linspace(-4,4,200) > yi=linspace(-4,4,200) > [Xi,Yi]=meshgrid(xi,yi) > > # This is the key step; find a z value for each grid point. > Zi=griddata(x,y,z,Xi,Yi) > > pcolor(Xi, Yi, Zi, shading='flat') > > show() > > The key here is this griddata function. It interpolates the surface at > the grid points based on the few data points I provide it with > (x,y,z). It uses Delaunay triangulation, and is part of the standard > MATLAB distribution (more about it here: > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/ > griddata.html#1007265). My question is whether anyone has come across > its implementation in python. I could not find any information in any > of the "standard" math packages. How do people do this? VTK, including the Python API, does Delaunay triangulation, and I've used it to do what you're talking about. IIRC, there are other Delaunay triangulation codes with Python bindings around. However, the Matlab function is a little more complicated; they use interpolation in addition to a straight Delaunay triangulation, and it often produces nice-looking results. They cite a reference in either the help file or the .m file; one can presumably read the reference and re-implement it for use in Python. FYI, here's some relevant Python VTK code: profile = vtkPolyData() profile.SetPoints(points) delny = vtk.vtkDelaunay2D() delny.SetInput(profile) delny.SetTolerance(0.01) delny.BoundingTriangulationOff() normals = vtk.vtkPolyDataNormals() normals.SetInput(delny.GetOutput()) lo,hi = zrange elevation = vtk.vtkElevationFilter() elevation.SetInput(delny.GetOutput()) elevation.SetLowPoint(0, 0, lo) elevation.SetHighPoint(0, 0, hi) elevation.SetScalarRange(lo, hi) elevation.ReleaseDataFlagOn() delMesh = vtk.vtkPolyDataMapper() delMesh.SetInput(elevation.GetOutput()) delMesh.SetLookupTable(lutLand) # doesn't work delActor = vtk.vtkActor() delActor.SetMapper(delMesh) ren1.AddActor( delActor ) Cheers! Andrew |
|
From: Perry G. <pe...@st...> - 2004-04-14 19:10:19
|
Eugeni Doljenko writes:
> > John Hunter wrote:
> > > Best is to use the binary string operations tostring and fromstring
> > >
> > > from Numeric import fromstring, Float
> > > # write
> > > file('fname.out', 'wb').write(x.tostring())
> > >
> > > # read
> > > x = fromstring(file('fname.out', 'rb').read(), Float)
> > >
> > > #If data is MxN you'll need to reshape
> > > x.shape = M,N
> > >
> > > Hope this help,
> > > JDH
> > >
> >
> > Note that numarray has a tofile method and a fromfile function
> > to do this without going through the copying required by tostring
> > and fromstring. Like those, it also doesn't save any shape or
> Moreover tostring() and fromstring() are deprecated iirc, because you can
> convert arrays from and to strings by StringIO.
>
I just noticed this recently. It isn't the case that tostring and
fromstring are deprecated for numarray. I just wanted to clarify.
Perry
|
|
From: Peter G. <pgr...@ge...> - 2004-04-14 18:45:35
|
Hello Everyone: Before I reinvent the wheel, I'd thought I'd ask: I have a set of x,y points in a plane, and to each a corresponding z. They are spread out in circular concentric orbits. I need to do a flat surface plot (via pcolor) of these z values. A simple algorithm would be: #get data for x, y, z.. this would be some fixed points x,y inside #a box -4<=x<=4 and -4<=y<=4 with a z value for each. #Create a grid xi=linspace(-4,4,200) yi=linspace(-4,4,200) [Xi,Yi]=meshgrid(xi,yi) # This is the key step; find a z value for each grid point. Zi=griddata(x,y,z,Xi,Yi) pcolor(Xi, Yi, Zi, shading='flat') show() The key here is this griddata function. It interpolates the surface at the grid points based on the few data points I provide it with (x,y,z). It uses Delaunay triangulation, and is part of the standard MATLAB distribution (more about it here: http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddata.html#1007265). My question is whether anyone has come across its implementation in python. I could not find any information in any of the "standard" math packages. How do people do this? Thanks, Peter |
|
From: John H. <jdh...@ac...> - 2004-04-13 18:42:05
|
>>>>> "David" == David Brown <db...@ya...> writes:
David> Also, not sure if it's relevant but if I try to continue in
David> IDLE I sometimes get "too many files open" errors as well
David> as mostly non-working windows. Any suggestions?
I have seen problems on win32 with repeatedly loading the same
freetype2 font in backend agg. I've implemented several changes in
the next release to fix this. Hopefully they will solve your problem.
Stay tuned...
JDH
|
|
From: David B. <db...@ya...> - 2004-04-13 17:42:59
|
I'm using Tkinter as the backend display for
matplotlib and also using IDLE -n. It works fine the
first several times I run it but ends up crashing and
taking down IDLE and pythonw.exe with it after ~10
runs of the script. I know this is not the best way
to use matplotlib right now. Anyway, here's the
plotting part of the script (.matplotlib set to
interactive mode)
if useMatplotlib:
yrange = 1.5
wfList = [p1, p2, p3]
close() # close last plot window if still open
nplots = len(waveformList)
i = 0
for p in wfList:
i +=1
subplot(nplots,1,i)
plot(p, color='#7070a0')
axis([0, totalPoints, -yrange, yrange])
ylabel('Volts')
grid(True)
Here's the eventual error message:
Traceback (most recent call last):
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python23\lib\lib-tk\Tkinter.py", line 1345,
in __call__
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 120, in resize
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 127, in show
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_agg.py",
line 342, in draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\figure.py",
line 83, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\axes.py",
line 527, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\axis.py",
line 395, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\axis.py",
line 93, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\text.py",
line 87, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_agg.py",
line 199, in draw_text
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_agg.py",
line 227, in compute_text_offsets
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_agg.py",
line 257, in _get_agg_font
RuntimeError: Could not load the facefile
File "C:\Documents and Settings\dlbrown\My
Documents\Python Scripts\gen_nonlinear_error.py", line
114, in ?
File
"C:\Python23\lib\site-packages\matplotlib\matlab.py",
line 942, in plot
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 46, in draw_if_interactive
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 127, in show
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_agg.py",
line 342, in draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\figure.py",
line 83, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\axes.py",
line 527, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\axis.py",
line 395, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\axis.py",
line 93, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\artist.py",
line 88, in draw
File
"C:\Python23\lib\site-packages\matplotlib\text.py",
line 87, in _draw
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_agg.py",
line 199, in draw_text
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_agg.py",
line 227, in compute_text_offsets
File
"C:\Python23\lib\site-packages\matplotlib\backends\backend_agg.py",
line 257, in _get_agg_font
RuntimeError: Could not load the facefile
Also, not sure if it's relevant but if I try to
continue in IDLE I sometimes get "too many files open"
errors as well as mostly non-working windows. Any
suggestions?
-- David
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
|
|
From: Al S. <a.d...@wo...> - 2004-04-13 16:27:24
|
On Tue, 2004-04-13 at 10:12, John Hunter wrote: > >>>>> "Philippe" == Philippe Strauss <phi...@pr...> writes: > > Philippe> Hello, I'm new to matplotlib and this list. > Philippe> Congratulation to the developers of this great package, > Philippe> I've been looking for a long while for a good quality > Philippe> plotting package. > > Philippe> I would like to plot time in hours on the x axis, with > Philippe> one minor grid per 15 minutes and one major grid per > Philippe> hour, but I can only see 10 fixed grids on all tutorial > Philippe> and documentation. > > Philippe> How can I configure that? > > No support for minor and major ticks yet, but I can add it pretty > quickly, probably for the next release due out soon. I just need a > little information. How do grids interact with major and minor ticks? > I know major ticks are generally bigger and are labeled, and minor > ticks are smaller and not labeled, but I don't know how grid lines are > usually handled with respect to major and minor ticks. If you have a > link to a canonical figure which uses major and minor ticks, I can > follow that example. > > JDH > I've also been playing around with plots versus time (in my case calendar time) and experimenting with tick style and ticklabel placement computed as a function of the time span. I attached a plot of one of my experiments. (This is where the need for multi-line ticklabels comes from.) The ticks and ticklabels that one wants differ according to the span of time plotted. For instance, for multi-year plots, the ticks are no finer than quarterly, but adjust to monthly, weekly, or daily if the span is sub-year. The tick placement is, of course, not uniform, because of the irregularities in the calendar. I have not experimented with sub-day time-spans of the kind shown by Philippe. -Al Schapira |
|
From: Philippe S. <phi...@pr...> - 2004-04-13 15:52:30
|
From: "John Hunter" <jdh...@ac... > >>>>> "Philippe" == Philippe Strauss <phi...@pr...> writes: > > Philippe> Hello, I'm new to matplotlib and this list. > Philippe> Congratulation to the developers of this great package, > Philippe> I've been looking for a long while for a good quality > Philippe> plotting package. > > Philippe> I would like to plot time in hours on the x axis, with > Philippe> one minor grid per 15 minutes and one major grid per > Philippe> hour, but I can only see 10 fixed grids on all tutorial > Philippe> and documentation. > > Philippe> How can I configure that? > > No support for minor and major ticks yet, but I can add it pretty > quickly, probably for the next release due out soon. I just need a > little information. How do grids interact with major and minor ticks? > I know major ticks are generally bigger and are labeled, and minor > ticks are smaller and not labeled, but I don't know how grid lines are > usually handled with respect to major and minor ticks. If you have a > link to a canonical figure which uses major and minor ticks, I can > follow that example. > > JDH for my application, I need something that looks like Tobias Oetiker RRD tool graph: This one is 1h per minor grid and tick, 6h per majors. Thanks!! |
|
From: John H. <jdh...@ac...> - 2004-04-13 14:34:48
|
>>>>> "Philippe" == Philippe Strauss <phi...@pr...> writes:
Philippe> Hello, I'm new to matplotlib and this list.
Philippe> Congratulation to the developers of this great package,
Philippe> I've been looking for a long while for a good quality
Philippe> plotting package.
Philippe> I would like to plot time in hours on the x axis, with
Philippe> one minor grid per 15 minutes and one major grid per
Philippe> hour, but I can only see 10 fixed grids on all tutorial
Philippe> and documentation.
Philippe> How can I configure that?
No support for minor and major ticks yet, but I can add it pretty
quickly, probably for the next release due out soon. I just need a
little information. How do grids interact with major and minor ticks?
I know major ticks are generally bigger and are labeled, and minor
ticks are smaller and not labeled, but I don't know how grid lines are
usually handled with respect to major and minor ticks. If you have a
link to a canonical figure which uses major and minor ticks, I can
follow that example.
JDH
|
|
From: Philippe S. <phi...@pr...> - 2004-04-13 13:07:14
|
Hello, I'm new to matplotlib and this list. Congratulation to the developers of this great package, I've been looking for a long while for a good quality plotting package. I would like to plot time in hours on the x axis, with one minor grid per 15 minutes and one major grid per hour, but I can only see 10 fixed grids on all tutorial and documentation. How can I configure that? -- Philippe Strauss |