From: Benjamin R. <ben...@ou...> - 2011-01-27 00:49:22
|
On Wednesday, January 26, 2011, C M <cmp...@gm...> wrote: > I usually do this for line graphs with markers: > > line, = self.subplot.plot_date(dates,data) > > along with some keywords to tweak the plot. I then add line to a > dictionary to keep track of it: > > self.line_to_data_dict[line] = self.activity > > But today I tried this with a bar chart, just changing plot_date to > bar and renaming the "line," to "bars,": > > fake_data = [2,2,5] > bars, = self.subplot.bar(fake_data, fake_data ) > > This gave me the error: ValueError: too many values to unpack. > > OK, so if I removed the comma from "bars," so it is just "bars", it > goes through but then I cannot add it to my dictionary--I get: > >> TypeError: list objects are unhashable > > Help in understanding this and a better approach would be helpful. Thanks, > Che > Just a thought, are you trying out the new legend code? Could you do a print of the type for bars? Ben Root |