On Fri, May 22, 2009 at 5:17 AM, Markus Feldmann <feldmann_mar...@gmx.de> wrote: > Hi All, > > i am in need of set the properties of my bar() Element, > by using a slider. > > For plots this looks like this: > self.plot = self.subplot1.plot(x,y) > setp(self.plot, xdata=new_x, ydata=new_y) > > How to do this with this, > self.bar = self.subplot2.bar(x,y)
It depends on what kinds of properties you want to set. For example, you could set the facecolor with plt.setp(self.bar, facecolor='red') But I would advise you against this method of coding -- it's great for simple interactive command line stuff, eg at the ipython prompt, but it sounds like you are doing something a little more sophisticated and would be better off plunging into the API. For example, you are calling the matplotlib.axes.Axes.bar method (since your subplot2 instance is a Subplot which is an Axes subclass). So start with the docs for Axes.bar http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.bar You will see in the docstring that it says it returns a sequence of Rectangle and has a link to the matplotlib.patches.Rectangle docs http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.Rectangle Those docs will show you all the properties (alpha, antialiased, ...facecolor, etc...) Each property has a link to the setter method. So I advise something like # the names "self.rectangles" is better than "self.bar" IMO since it describe whats kinds of mpl # object it are referring to self.rectangles = self.ax2.bar(something) for rectangle in self.rectangles: rectangle.set_alpha(0.4) rectangle.set_facecolor('green') JDH ------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users