Burst Pressure of a thick-walled Sphere
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: Burst Pressure of a thick-walled Sphere
Matplotlib. See source code.
Re: Burst Pressure of a thick-walled Sphere
Sorry I was in a hurry.
cnt is used to complete the calculation or add 10 more steps.
Code: Select all
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
cnt = plot(un, lbd)
def plot(un, lbd):
class Index(object):
def stop(self, event):
self.cnt = False
plt.close()
def add(self, event):
self.cnt = True
plt.close()
callback = Index()
callback.cnt=False
fig, ax = plt.subplots()
plt.subplots_adjust(bottom=0.2)
ax.plot(un, lbd, '-ok', color='black')
ax.set(xlabel='displacement [mm]', ylabel='load factor [-]',
title='')
ax.grid()
axstop = plt.axes([0.7, 0.05, 0.1, 0.075])
axadd = plt.axes([0.81, 0.05, 0.1, 0.075])
bstop = Button(axstop, 'stop')
bstop.on_clicked(callback.stop)
badd = Button(axadd, 'add')
badd.on_clicked(callback.add)
# fig.savefig("test.png")
plt.show()
return callback.cnt