Hi All,
I have switched from matplotlib 0.91.2 to 0.98.1, and I have
noticed a couple of "strange" behaviours (I am not using PyLab, but
matplotlib embedded in wxPython):
1) If I use:
ylims = self.myAxis.get_ylim()
And then I add other lines to the plot, the value of ylims is
modified. It gets modified even if I use something like this:
ylims = self.myAxis.get_ylim()[:]
The only way of keeping the ylims list untouched by other plotting
commands I have to do this:
ylims = copy.deepcopy(self.leftaxis.get_ylim())
Which is a bit of an overkill. See the attached Python script for an
example. This did not happen before in 0.91.2.
2) The dashed text positioning is wrong, you can see it by running
dashpointlabel.py in the
matplotlib_examples_0.98.1\examples\pylab_examples: the position of
the values should be at the other end of the dash, not over the
plotted point.
Am I missing something?
Thank you for your suggestions.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
#!/usr/bin/env python
import wx
from numpy import arange, sin, pi
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
class CanvasFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None,-1,
'CanvasFrame',size=(550,350))
self.SetBackgroundColour(wx.NamedColor("WHITE"))
self.figure = Figure()
self.canvas = FigureCanvas(self, -1, self.figure)
self.axes = self.figure.add_subplot(111)
t = arange(0.0, 3.0, 0.01)
s = sin(2*pi*t)
self.axes.plot(t,s)
ylims = self.axes.get_ylim()
print "\nBEFORE ADDING ANOTHER PLOT ==> ylims =", ylims
self.axes.plot([2.0], [3.0])
print "AFTER ADDING ANOTHER PLOT ==> ylims =", ylims
def OnPaint(self, event):
self.canvas.draw()
class App(wx.App):
def OnInit(self):
'Create the main window and insert the custom frame'
frame = CanvasFrame()
frame.Show(True)
return True
app = App(0)
app.MainLoop()
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users