[matplotlib-devel] pylib dynamic plot.
I just want to a dynamic plot with a line show in a plot. The line changes every second when it gets the different data(xdata(),ydata()) from list[i]. list[1]=([1,2],[3,5]) list[2]=([1,2],[3,5],[5,4]) list[3]=([1,2],[3,5],[5,4],[7,6]) list[4]=([1,2],[3,5],[5,4],[7,6],[9,7]).. for example, when list[1] in set for the data of the line, I will get a line with two point (1,2)(3,5). After a second,list[2] is auto setted for the data of the line, and I will get a line with three point. With the different list[i] setted for the line, the line changed. I just tried it again and again, but failed. Can somebody help me? And just give a short code to do it. Thank you. -- View this message in context: http://www.nabble.com/pylib-dynamic-plot.-tf4859796.html#a13907020 Sent from the matplotlib - devel mailing list archive at Nabble.com. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] matplotlib.image.AxesImage can't work.
I just want to show a matplotlib.image.AxesImage on a figure. But It can't work properly. Can somebody help me? The code are following: when I run it , It just show a white figure. But I Set it cm.Greens .It doesn't work . Why? # -*- coding:gb2312 -*- import matplotlib matplotlib.use("WXAgg") matplotlib.interactive(True) from matplotlib.backends.backend_wx import FigureCanvasWx from matplotlib.figure import Figure from matplotlib.axes import Subplot from numpy import * import wx class ShowPlot(): def __init__(self,Frame): delta = 0.025 x = arange(-2.0, 2.0, delta) y = arange(-2.0, 2.0, delta) X, Y = meshgrid(x, y) Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) Z = 10.0 * (Z2 - Z1) levels = arange(-1.2, 1.6, 0.2) self.fig = Figure((6,6), 70) self.canvas = FigureCanvasWx(Frame, -1, self.fig) self.axe=self.fig.add_axes([0.1, 0.1, 0.8, 0.8]) i=matplotlib.image.AxesImage(self.axe,data=Z,interpolation='bilinear', origin='lower',cmap=cm.Greens, extent=(-2,2,-2,2)) app = wx.PySimpleApp() f=wx.Frame(None,size=(600,600)) f.Show(True) ShowPlot(f) app.MainLoop() -- View this message in context: http://www.nabble.com/matplotlib.image.AxesImage-can%27t-work.-tf4897267.html#a14025951 Sent from the matplotlib - devel mailing list archive at Nabble.com. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] How to show matplotlib.image ?
The following run well . But I just want to make the image, with the x and y as axis and z as the image value ,show on the figure. In the pylab , we can just give a command "imshow" ,But here , I fail to do it , I have try ax.imshow() again and again ,but fail. Can sb give me some advice . Thank you . import matplotlib matplotlib.use("WXAgg") matplotlib.interactive(True) from matplotlib.backends.backend_wx import FigureCanvasWx from matplotlib.figure import Figure from matplotlib.axes import * from numpy import * import wx from pylab import * #--- class DynamicPlot(): def __init__(self,Frame): delta = 0.025 x = arange(-3.0, 3.0, delta) y = arange(-2.0, 2.0, delta) X, Y = meshgrid(x, y) Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) Z = 10.0 * (Z2 - Z1) levels = arange(-1.2, 1.6, 0.2) self.fig = Figure((8,8), 75) self.canvas = FigureCanvasWx(Frame, -1, self.fig) ax=self.fig.add_axes([0.1,0.1,0.8,0.8]) ax.contour(X,Y,Z,levels,origin='lower',linewidths=2,extent=(-3,3,-2,2)) app = wx.PySimpleApp() f=wx.Frame(None,size=(600,600)) f.Show(True) DynamicPlot(f) app.MainLoop() -- View this message in context: http://www.nabble.com/How-to-show-matplotlib.image---tf4912839.html#a14064300 Sent from the matplotlib - devel mailing list archive at Nabble.com. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] matplotlib.image.AxesImage can't work.
Thank u for your help. I did it as your reply. But some questions appear again . Can you give me some more advice , your help will be appreciated. Code are as following: You know when I do "self.ax.images.append(self.im)" in pylab . It do properly , But ,it fail here. Thank you! # -*- coding:gb2312 -*- import matplotlib matplotlib.use("WXAgg") matplotlib.interactive(True) from matplotlib.backends.backend_wx import FigureCanvasWx from matplotlib.figure import Figure from matplotlib.axes import * from numpy import * import wx from matplotlib.image import NonUniformImage import numpy as npy #--- class DynamicPlot(): def __init__(self,Frame): x = npy.arange(-4, 4, 0.005) y = npy.arange(-4, 4, 0.005) z = npy.sqrt(x[npy.newaxis,:]**2 + y[:,npy.newaxis]**2) self.fig = Figure((8,8), 75) self.canvas = FigureCanvasWx(Frame, -1, self.fig) self.ax=self.fig.add_subplot(111) self.im = NonUniformImage(self.ax) self.im.set_data(x, y, z) self.ax.images.append(self.im) self.ax.imshow(self.im) app = wx.PySimpleApp() f=wx.Frame(None,size=(600,600)) f.Show(True) DynamicPlot(f) app.MainLoop() -- View this message in context: http://www.nabble.com/matplotlib.image.AxesImage-can%27t-work.-tf4897267.html#a14057748 Sent from the matplotlib - devel mailing list archive at Nabble.com. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] pylib dynamic plot.
Yeah! The code helps me a lot. Thank you! Cong from China -- View this message in context: http://www.nabble.com/pylib-dynamic-plot.-tp13907020p15249839.html Sent from the matplotlib - devel mailing list archive at Nabble.com. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel