From: John H. <jdh...@ac...> - 2004-11-10 14:55:21
|
>>>>> "Jos=E9" =3D=3D Jos=E9 Alexandre Nalon <na...@te...> writes: Jos=E9> Hello, Matplotlib has been helping me a lot with my graphic Jos=E9> needs. I am still surprised by the looking of the Jos=E9> pictures. Many thanks for the great software. Jos=E9> I'm having some issues, though. Sometimes I get error Jos=E9> messages, usually an error in KERNEL32.DLL on Windows ME, Jos=E9> and on Windows only, I don't get this behaviour in Jos=E9> Linux. It's not as bad as it may seem, as every script runs Jos=E9> completely, the pictures are saved and, besides the message Jos=E9> box informing the error, nothing weird happens. I don't know Jos=E9> how to reproduce the errors - when I run from the DOS prompt Jos=E9> or from IDLE, I get the messages. When I run from my IDE (I Jos=E9> use PSPad) I usually don't get error messages, with the same Jos=E9> scripts. Any hint to what I can be doing wrong, or how to Jos=E9> find out what is happening? I haven't seen this one before. Intermittent errors are the hardest to track down. What GUI is PSPad based on. Is any of the information at http://matplotlib.sourceforge.net/faq.html#FREEZE helpful? Jos=E9> Also, I'm in need of some help. I must draw six subplots, Jos=E9> one below the other (subplot(6, ...)), but the way things Jos=E9> are coming out, the plots are to thin, and, although the Jos=E9> picture looks good, I thought that if I could make each Jos=E9> subplot a little bigger, that would help a lot. Is there any Jos=E9> way this can be done? subplot is simply a thin wrapper to axes - http://matplotlib.sf.net/matplotlib.matlab.html#-axes . You can use axes to make the axes any size you want. The syntax is # left, bottom, width, height ax1 =3D axes([0.125, 0.1, 0.7, .8]) where all values are fractions of the total figure size. See http://matplotlib.sourceforge.net/examples/ganged_plots.py for an example where no space is left between the axes, and xlabels are put only on the bottom. Jos=E9> In other plots, I need to index the subplots (label them Jos=E9> '(a)', '(b)', ... for reference in text). I was using xlabel Jos=E9> to do that, but when I have more than two subplots, the Jos=E9> xlabel is shadowed by the following subplot. Is there any Jos=E9> way to make the space between the plots bigger, so the Jos=E9> xlabels can be shown, or is there any other (better) way to Jos=E9> do that? You can use the text command to place text anywhere in the figure you want - http://matplotlib.sourceforge.net/matplotlib.matlab.html#-text. You can place text in data coordinates text(.5, 12, 'hi mom') in which case the text will "move" visually if you pan and zoom the axes, or in axes coordinates (0,0) is lower left and 1,1 is upper right, in which case the text will remain stationary with respect to changes in the axes limits text(0.05, 0.9, 'hi mom', transform=3Dgca().transAxes) See http://matplotlib.sourceforge.net/examples/alignment_test.py for lots of examples showing text placement and alignment. You can also place text outside the axes using the text command # to the left and above the axes box text(-0.1, 1.05, 'hi mom', transform=3Dgca().transAxes) Hope this helps, JDH |