From: matthew a. <ma...@ca...> - 2004-03-05 05:07:16
|
Hi Now that we have the lovely new syntax for setting legend labels for each line: plot(x, sin(x), label='sin(x)') plot(x, cos(x), label='cos(x)') how do we then move the legend from the default upper right location? legend() turns the legend on, but the LOC argument has to be second or third, after the LINES and/or LABELS. What about a new loc keyword for legend? E.g. legend(loc=5) While we're talking about problems inherited from matlab's use of positional arguments, is there some easy way to set the x or y axis limits without setting the other axis? E.g. if I want to leave the x axis automatic, but manually set the y axis? I looked at help(axis) and at http://matplotlib.sourceforge.net/matlab_commands.html and I couldn't see anything obvious like xaxis or yaxis functions. This works: autoaxis = axis() autoaxis[2:4] = (ymin, ymax) axis(autoaxis) but what if I add a plot afterwards that changes the x axis limits? And it seems like hard work compared to: yaxis(ymin, ymax) Cheers, Matthew. |