|

楼主 |
发表于 2020-8-7 16:35:40
|
显示全部楼层
- ## Plotting the problem
- plt.figure(str(np.random.rand()))
- plt.hold(True)
- plt.grid(True)
- # Plot the circular arc center.
- plt.plot(slipArcSTR['center'][0], slipArcSTR['center'][1], 'kx')
- # Plot the slip circular arc.
- plt.plot(arcPointsCoordsArray[:,0], arcPointsCoordsArray[:,1], 'k-', \
- lw=0.3)
- # Plot the slices.
- for i in range(len(slicesSTRCell)):
- plotslice(slicesSTRCell[i])
- # Plot the material boundary and the slope geometry.
- plt.plot(boundPointsCordsArray[:,0], boundPointsCordsArray[:,1], 'k-')
- # Plot the terrain surface.
- plt.plot(surfaceChordsArray[:,0], surfaceChordsArray[:,1], 'k', lw=2)
- # Plot the water table.
- plt.plot(wtCoordsArray[:,0], wtCoordsArray[:,1], 'b-')
- # Plot the radius of the arc at both ends.
- radius1PlotArray = np.vstack((slipArcSTR['center'], pointAtToeVec))
- plt.plot(radius1PlotArray[:,0], radius1PlotArray[:,1], 'k--', lw=0.5)
- radius2PlotArray = np.vstack((slipArcSTR['center'], pointAtCrownVec))
- plt.plot(radius2PlotArray[:,0], radius2PlotArray[:,1], 'k--', lw=0.5)
- # Plot the factor of safety value in graphic.
- if methodString == 'Allm':
- fsText = ' $f_{\mathrm{s}\, \mathrm{(Fellenius)}}=+\
- format(selectedFs[0], '.3f')+'\n'+\
- ' $f_{\mathrm{s}\, \mathrm{(Bishop\, Simp.)}}=+\
- format(selectedFs[1], '.3f')
- else:
- if methodString == 'Bshp':
- fsText = ' $f_{\mathrm{s}\, \mathrm{(Bishop\, Simp.)}}=+\
- str(format(selectedFs, '.3f'))
- else:
- fsText = ' $f_{\mathrm{s}\, \mathrm{(Fellenius)}}=+\
- str(format(selectedFs, '.3f'))
- plt.text(0, surfaceChordsArray[0,1], fsText, fontsize = 11, \
- horizontalalignment='left', verticalalignment='bottom')
- ## Final plot details.
- plt.axis('equal')
- plt.xlabel('$x$ distance')
- plt.ylabel('$y$ distance')
- plt.title(projectName)
- plt.hold(False)
- plt.savefig(projectName+outputFormatImg, dpi=300)
复制代码 |
|