From: Mauricio C. <moc...@gm...> - 2014-02-01 15:45:02
|
Hi there, I have the following simple code to plot a (static) fill_between region in a given plot. import numpy as np import matplotlib. pyplot as plt plt.figure() ax=plt.axes() ax.set_xlim([0,10000]) x = np.linspace(6000.,7000.) y = np.ones(np.shape(x)) plt.fill_between(x,y) I would like now to animate this band (which is a PolyCollection object, and not a Line2D one) so that it moves smoothly to the right up together with being stretched, that is, to the new x positions: .7200, 8400. I saw several animations in the matplotlib homepage, but they only looped over line or image objects, not polycollection ones, such as fill_between... Is this possible? In stackoverflow there is this link: http://stackoverflow.com/questions/16120801/matplotlib-animate-fill-between-shape, which might solve this question but I was not able to understand it fully in order to have a simple minmal working example. If that is the right direction, I would appreciate immensely if someone could provide such an example! Thanks in advance -- ####################################### Prof. Mauricio Ortiz Calvao Federal University of Rio de Janeiro Institute of Physics, P O Box 68528 CEP 21941-972 Rio de Janeiro, RJ Brazil Email: or...@if... Phone: (55)(21)25627483 Homepage: http://www.if.ufrj.br/~orca ####################################### |