Hi again,
I'm getting some partial results with the script subplot_test.py in
attachement. It has though 2 problems :

- the set_aspect(0.333*Dx/Dy) seems to occupy on ly 1/3 of its allowed
space. Is it a bug ?

- the last 2 columns are empty but belong to the figure, this means unwanted
empty space that I'll have to cut it, for example modifying the bounding box
if I output a eps file.

I also tryed the get_position() seems to allow more possibilities. I
eventually achieve something similar to my needs, see subplot_test2.py
Is it possible to do something similar but faster?

Is it possible to fix canvas size or output size (when saving in a file) so
that dimensions of plots would always be the same?
from pylab import *

x=rand(100)
y=rand(100)

ax1=subplot(221)
ax1.plot(100*rand()*x,100*rand()*y,'+')
Dx=abs(ax1.get_xlim()[0]-ax1.get_xlim()[1])
Dy=abs(ax1.get_ylim()[0]-ax1.get_ylim()[1])
ax1.set_aspect(0.333*Dx/Dy)
ax1.set_xticklabels([])

ax2=subplot(264)
ax2.plot(100*rand()*x,100*rand()*y,'+')
Dx=abs(ax2.get_xlim()[0]-ax2.get_xlim()[1])
Dy=abs(ax2.get_ylim()[0]-ax2.get_ylim()[1])
ax2.set_aspect(Dx/Dy)
ax2.set_xticklabels([])

ax3=subplot(223)
ax3.plot(100*rand()*x,100*rand()*y,'+')
Dx=abs(ax3.get_xlim()[0]-ax3.get_xlim()[1])
Dy=abs(ax3.get_ylim()[0]-ax3.get_ylim()[1])
ax3.set_aspect(0.333*Dx/Dy)

ax4=subplot(2,6,10)
ax4.plot(100*rand()*x,100*rand()*y,'+')
Dx=abs(ax4.get_xlim()[0]-ax4.get_xlim()[1])
Dy=abs(ax4.get_ylim()[0]-ax4.get_ylim()[1])
ax4.set_aspect(Dx/Dy)

show()
from pylab import *

x=rand(100)
y=rand(100)

ax1=subplot(221)
ax1.plot(100*rand()*x,100*y,'+')
Dx=abs(ax1.get_xlim()[0]-ax1.get_xlim()[1])
Dy=abs(ax1.get_ylim()[0]-ax1.get_ylim()[1])
#ax1.set_aspect(0.333*Dx/Dy)
ax1.set_xticklabels([])

ax2=subplot(264)
ax2.plot(100*rand()*x,100*rand()*y,'+')
Dx=abs(ax2.get_xlim()[0]-ax2.get_xlim()[1])
Dy=abs(ax2.get_ylim()[0]-ax2.get_ylim()[1])
#ax2.set_aspect(Dx/Dy)
ax2.set_xticklabels([])

ax3=subplot(223)
ax3.plot(100*rand()*x,100*y,'+')
Dx=abs(ax3.get_xlim()[0]-ax3.get_xlim()[1])
Dy=abs(ax3.get_ylim()[0]-ax3.get_ylim()[1])
#ax3.set_aspect(0.333*Dx/Dy)

ax4=subplot(2,6,10)
ax4.plot(100*rand()*x,100*rand()*y,'+')
Dx=abs(ax4.get_xlim()[0]-ax4.get_xlim()[1])
Dy=abs(ax4.get_ylim()[0]-ax4.get_ylim()[1])
#ax4.set_aspect(Dx/Dy)

ax1.set_position([0.07,0.5,0.55,0.4])
ax2.set_position([0.67,0.55,0.3,0.3])
ax3.set_position([0.07,0.1,0.55,0.4])
ax4.set_position([0.67,0.15,0.3,0.3])
show()
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to