From: Eric F. <ef...@ha...> - 2010-06-01 23:35:37
|
On 06/01/2010 01:17 PM, Fernando Perez wrote: > Hi all, > > I just spent some time digging through the matplotlib code, and I see > that the errorbar line width argument isn't passed through to the > underlying call. In axis.bar, we have this code: > > if xerr is not None or yerr is not None: > if orientation == 'vertical': > # using list comps rather than arrays to preserve unit info > x = [l+0.5*w for l, w in zip(left, width)] > y = [b+h for b,h in zip(bottom, height)] > > elif orientation == 'horizontal': > # using list comps rather than arrays to preserve unit info > x = [l+w for l,w in zip(left, width)] > y = [b+0.5*h for b,h in zip(bottom, height)] > > self.errorbar( > x, y, > yerr=yerr, xerr=xerr, > fmt=None, ecolor=ecolor, capsize=capsize) > > while errorbar has this signature: > > def errorbar(self, x, y, yerr=None, xerr=None, > fmt='-', ecolor=None, elinewidth=None, capsize=3, > barsabove=False, lolims=False, uplims=False, > xlolims=False, xuplims=False, **kwargs): > > For a poster, we wanted thicker errorbars drawn and had to resort to: > > plt.rcParams['lines.markeredgewidth'] = 2 > plt.rcParams['lines.linewidth'] = 2 > > and reverting back to normal width after making the errorbar calls. > Should I file a ticket about this, or are such fine-tuning tasks > considered as fair game for rcParams manipulations? No, that seems like a terrible kluge--not at all what rcParams is for. bar, errorbar, hist could use some major refactoring. In the meantime, since bar simply calls errorbar, it seems to me that the solution is for bar to take a kwarg, say "errorkw", which is a dict that will be passed to errorbar via **errorkw, and that can have any valid errorbar kwargs in it. There is some precedent for this sort of thing, and I find it a useful way of keeping kwargs from getting out of control when one is making complicated compound plots. If there is no objection, I will do it. Eric > > I'm happy to file the ticket, I just don't want to create unnecessary > noise if the rcparams is meant to be 'the way' to do it. > > Cheers, > > f > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel |