I have some code:
def print_fractures(fractures):
# generate ends for the line segments
xpairs = []
ypairs = []
plt.subplot(132)
for i in range(len(fractures)):
xends = [fractures[i][1][0], fractures[i][2][0]]
yends = [fractures[i][1][1], fractures[i][2][1]]
xpairs.append(xends)
ypairs.append(yends)
for xends,yends in zip(xpairs,ypairs):
plt.plot(xends, yends, 'b-', alpha=0.4)
plt.plot()
plt.xlabel("X Coordinates (m)")
plt.ylabel("Y Coordinates (m)")
plt.ylim((0,400))
def histogram(spacings):
plt.subplot(131)
plt.hist(np.vstack(spacings), bins = range(0,60,3), normed=True)
plt.xlabel('Spacing (m)')
plt.ylabel('Frequency (count)')
#plt.title("Fracture Spacing Histogram")
def plotCI(sample, ciHigh, ciLow, avgInts):
plt.subplot(133)
plt.plot(sample,ciHigh)
plt.plot(sample,avgInts)
plt.plot(sample,ciLow)
plt.legend(['Mean + 95% CI', 'Mean', 'Mean - 95% CI'])
plt.title("Intersections vs Number of Wells")
plt.xlabel("# of Wells")
plt.ylabel("# of Intersections for " + str(bedT) + "m bed thickness")
def makeplots(spacings,fractures):
histogram(spacings)
print_fractures(fractures)
plt.axis('equal')
plotCI(sample, ciHigh, ciLow, avgInts)
plt.show()
makeplots(spacings,fractures)
The code produces the following plot:
As you can see, in the center plot, the plot is not really centered... I would like to set the x and y axes to (0,400) but I am having troubles.
So far I have tried:
plt.axis((0,400,0,400))
and:
plt.ylim((0,400))
plt.xlim((0,400))
Neither option worked for me.
plt.axis("tight")
? – Trond Kristiansen Jan 31 at 20:05cs=plt.plot(xends, yends, 'b-', alpha=0.4); cs.axis("tight")
and remove the extra plt.plot() and see if that helps. – Trond Kristiansen Jan 31 at 21:03