On 05.03.2014 20:56, Adam Hughes wrote:> Hi, > > I am making a stacked histogram where one must enter the desired colors > together in a list/array when the histogram is called. For certain > objects in my code, it's helpful to assign a color to them, so that they > are immediately identified across various plots. Therefore, I > essentially want to take the color cycle, swap out a few entries for > which colors have been assigned by the user, and otherwise keep the > cycle in tact. For example, if the first object is to be orange, but no > other colors are assigned, I want something like: > > colors= ['orange', default_cycle[1::]] > > However, according to some threads, the only way to access the color > cycle that I'm aware of is through a generator stored in: > > axes._get_lines.color_cycle()
If I'm not mistaken, you should be able to set the appropriate rcParam, i.e., mpl.rcParams['axes.color_cycle'] = ['orange', default_cycle[1::]] Cheers, Andreas. > > I don't like this approach because iterating through the color cycle > will cause the next plot to start at a different point in the cycle. > I'm sure I can hack something up that gets around this, but there seems > to be a canonical way to just list all of the default colors in a list > once and be done with it. Is this the case? > > Thanks. > > > ------------------------------------------------------------------------------ > Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce. > With Perforce, you get hassle-free workflows. Merge that actually works. > Faster operations. Version large binaries. Built-in WAN optimization and the > freedom to use Git, Perforce or both. Make the move to Perforce. > http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- -- Andreas. ------------------------------------------------------------------------------ Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce. With Perforce, you get hassle-free workflows. Merge that actually works. Faster operations. Version large binaries. Built-in WAN optimization and the freedom to use Git, Perforce or both. Make the move to Perforce. http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users