From: Dominique O. <Dom...@po...> - 2004-03-19 22:23:45
|
John Hunter wrote: >>>>>>"Dominique" == Dominique Orban <Dom...@po...> writes: > > > Dominique> Regarding my previous message on TeX labels, it would > Dominique> seem that having parentheses in there mix up the > Dominique> alignment. Not "regular" text, as i previously > Dominique> suggested. Your trick did it just fine. TeX titles and y-labels appear correctly now. Vertical y-labels are not an issue for me right now. Perhaps other users? > Dominique> A final comment, using gca().set_yticks( ... ) prints a > Dominique> large number of messages "<matplotlib.axis.YTick > Dominique> instance at ...>". There must be a print somethere. > > You're in interactive mode right? In a python shell > > >>>>2+2 > > 4 > >>>>x = 2+2 >>>> > > > > Ie, an expression which is not assigned to a name is printed in the > shell in interactive mode. set_ticks returns a list of tick labels to > allow you to do things like > > labels = gca().set_yticks(['a', 'b', 'c']) > set(labels, 'color', 'r') > > The point is, if you assign the return value of set_ticks a name, it > should no longer print to the shell. Ditto for other plot functions > that return a value. If this doesn't cure you, let me know. A > residual print is always a possibility. Well i agree with the above, but i wasn't in interactive mode. Moreover, gca().set_xticks doesn't print anything. Here is an example: >>> import matplotlib >>> matplotlib.use( 'TkAgg' ) >>> from matplotlib.matlab import * >>> x = [1,2,3,4] >>> y = [2,1,4,3] >>> plot(x,y) [<matplotlib.lines.Line2D instance at 0x01092B20>] >>> show() >>> gca().set_xticks( [1,2,3,4] ) >>> show() >>> gca().set_yticks( [1,2,3,4] ) [<matplotlib.axis.YTick instance at 0x010738A0>, <matplotlib.axis.YTick instance at 0x010793F0>, <matplotlib.axis.YTick instance at 0x01079F08>, <matplotlib.axis.YTick instance at 0x01076A58>] >>> show() The two set_[xy]ticks commands work fine. For some reason though, set_yticks outputs tick instances in the terminal. Cheers, Dominique |