From: James B. <bo...@ll...> - 2004-02-23 19:01:27
|
On Feb 23, 2004, at 9:16 AM, John Hunter wrote > > Perhaps a better solution is to allow keyword args to the plot command > > plot(datar, -1.0*pr, 'b', > linewidth=0.2, label='a red line', alpha=0.2) > > This could be extended to handle plot multiple plots with one command > as follows > > plot(x1, y1, 'b', x2, y2, 'r--', > linewidth=(2,3), label=('a blue line', 'a red line'), > alpha=(1.0,0.5), antialiased = (True,False)) > I strongly agree with the kwargs approach, it makes things clear as to what is being set. > Just an oversight on my part - I've been adding these neglected > accessor methods as people need them. The axes border is a > patches.Rectangle instance. If you add the following accessor method > to class Axes (on or around line 598) > > def get_frame(self): > "Return the axes Rectangle frame" > return self._axesPatch > from matplotlib.matlab import * > ax = subplot(111) > plot([1,2,3]) > frame = ax.get_frame() > frame.set_linewidth(3.0) > frame.set_facecolor('r') > frame.set_edgecolor('y') > show() I applied this patch and it worked fine. On my Mac I use the PS backend and convert to PDF. With the default frame width (0.5), the frame was not visible using Adobe Reader 6.0. The file printed fine, but the on screen viewing omitted the frame. This might be a personal problem on my setup, but it might be useful if other people have this difficulty. Making the frame width equal to 1 fixes things. using matplotlib and lovin' it. Jim |