python Programming Glossary: ydata
Closing pyplot windows http://stackoverflow.com/questions/11140787/closing-pyplot-windows If I want to change a property of the line like change the ydata I can do so by referring to this handle. I can also create a.. C sC.val y_data A x_data x_data B x_data C par_plot.set_ydata y_data draw The par_plot.set_ydata y_data changes the ydata.. B x_data C par_plot.set_ydata y_data draw The par_plot.set_ydata y_data changes the ydata property of the Line2D object with..
Cython and numpy speed http://stackoverflow.com/questions/1199972/cython-and-numpy-speed .001 xdata 1. sin 2 pi 1. times .5 sin 2 pi 1.1 times 1. ydata .5 sin 2 pi 1.1 times def xcorr x y return correlate x y mode.. return xy if __name__ __main__ N 10 t Timer xcorr xdata ydata from __main__ import xcorr xdata ydata print 'xcorr' t.timeit.. t Timer xcorr xdata ydata from __main__ import xcorr xdata ydata print 'xcorr' t.timeit number N N t Timer fftxcorr xdata ydata..
Getting standard errors on fitted parameters using the optimize.leastsq method in python http://stackoverflow.com/questions/14581358/getting-standard-errors-on-fitted-parameters-using-the-optimize-leastsq-method-i the residual variance ie. s_sq func popt args 2 .sum len ydata len p0 pcov pcov s_sq as in curve_fit.py. This is because leastsq..
Fitting a 3D array of data to a 1D function with numpy or scipy http://stackoverflow.com/questions/15094619/fitting-a-3d-array-of-data-to-a-1d-function-with-numpy-or-scipy do this func1d lambda y args optimize.curve_fit f xdata x ydata y args 0 # 0 to get only popt param np.apply_along_axis func1d.. func1d lambda y args optimize.curve_fit f xdata x ydata y args 0 # 0 to get only popt param np.apply_along_axis func1d..
Matplotlib, adding text with more than one line. Adding text that can follow the curve http://stackoverflow.com/questions/17252790/matplotlib-adding-text-with-more-than-one-line-adding-text-that-can-follow-the x y s kwargs from scipy.optimize import curve_fit xdata ydata line.get_data dist np.sqrt x xdata 2 y ydata 2 dmin dist.min.. xdata ydata line.get_data dist np.sqrt x xdata 2 y ydata 2 dmin dist.min TOL_to_avoid_rotation 0.3 if dmin TOL_to_avoid_rotation.. xs xdata index 2 index 1 index index 1 index 2 ys ydata index 2 index 1 index index 1 index 2 def f x a0 a1 a2 a3 return..
Deleting and Redrawing Matplotlib Animation http://stackoverflow.com/questions/18391038/deleting-and-redrawing-matplotlib-animation pi 50 xdata self.maxRadius z np.array cos q for q in theta ydata self.maxRadius z np.array sin q for q in theta zdata z np.ones.. self 'plot_handle' plot_handle self.axes.plot xdata ydata zdata 0 else plot_handle self.plot_handle plot_handle.set_data.. plot_handle self.plot_handle plot_handle.set_data xdata ydata plot_handle.set_3d_properties zdata return plot_handle def animate..
Is there a matplotlib equivalent of MATLAB's datacursormode? http://stackoverflow.com/questions/4652439/is-there-a-matplotlib-equivalent-of-matlabs-datacursormode False def __call__ self event self.event event # xdata ydata event.artist.get_data # self.x self.y xdata event.ind ydata.. event.artist.get_data # self.x self.y xdata event.ind ydata event.ind self.x self.y event.mouseevent.xdata event.mouseevent.ydata.. self.x self.y event.mouseevent.xdata event.mouseevent.ydata if self.x is not None self.annotation.xy self.x self.y self.annotation.set_text..
|