Hello again,
I’ve actually made some more progress on my last question after finding this site: http://www.scipy.org/Cookbook/Matplotlib/Multiple_Subplots_with_One_Axis_Label
and I was able to adjust the widths of my spacing.
My current plot looks like this:
http://imageshack.us/photo/my-images/849/current.png/
with source code that looks like:
adjustprops = dict(left=0.1, bottom=0.1, right=0.97, top=0.93, wspace=0.25, hspace=0.25)
fig=figure()
fig.subplots_adjust(**adjustprops)
ax=subplot(221)
plot(x2cp,y2cp,‘bo’,markersize=3)
#ax.set_title(‘2cP’)
text(12,0.03,‘2cP’)
#ylabel(‘Displacement’)
axis([0,16,0,0.04])
bx=subplot(223)
plot(x2cb,y2cb,‘bo’,markersize=3)
#ax.set_title(‘2cB’)
text(12,0.225,‘2cB’)
axis([0,16,0,0.3])
cx=subplot(222)
plot(x6fp,y6fp,‘bo’,markersize=3)
#ax.set_title(‘6fP’)
text(12,0.03375,‘6fP’)
axis([0,16,0,0.045])
dx=subplot(224)
plot(x6fb,y6fb,‘bo’,markersize=3)
#ax.set_title(‘6fB’)
text(12,0.225,‘6fB’)
axis([0,16,0,0.3])
show()
Now the only thing I’d like to do now is create a global y-axis and a global x-axis along the bottom for all 4 plots (which the website I linked to above gives some hints about, but trying what I thought was equivalent didn’t work). And lastly, I wanted those y-axes which go from 0.000 to 0.040 to instead go from 0.00 to 0.04 (i.e., only two decimal places, getting rid of the ones that are in between).
Thanks for any guidance you can give.
Best,
Brad
···
On Mon, Sep 19, 2011 at 3:32 PM, Brad Malone <brad.malone@…287…> wrote:
Hi, I am trying to do a simple 2x2 box of plots. My code is so far very simple, and simply looks something like this.
ax=subplot(221)
plot(x2cp,y2cp)
ax.set_title(‘2cP’)
ylabel(‘Displacement’)
ax=subplot(222)
plot(x2cb,y2cb)
ax.set_title(‘2cB’)
ax=subplot(223)
plot(x6fp,y6fp)
ax.set_title(‘6fP’)
ax=subplot(224)
plot(x6fb,y6fb)
ax.set_title(‘6fB’)
show()
But when I do this, the text and numbers from various plots overlap each other and get in the way (I noticed this is a common problem among the images in the matplotlib gallery as well). I have 2 questions:
1). How can I control the spacing, or padding, between the plots so that the numbers don’t overlap?
2). Is there a way for me to have a single common y-axis label and x-axis label that runs along the full left-hand side and bottom, respectively?
Thanks so much for the help!
Brad