How to use matplotlib to plot stress function graph?
<p>everyone!
I'm new to python and PyQT.
I want to calculate stress tensor components using this formula</p>

<p><a href="http://i.stack.imgur.com/MnGjS.jpg" rel="nofollow">Stress tensor component</a></p>

<p>where lambda, mu, and alpha - are constants, and T - is the change of temperature.</p>

<p>and then plot it using matplotlib, with temperature change on the x-axis, and the change of stress on the y-axis.</p>

<p>I've made a GUI in QT Designer with three buttons, to calculate for different materials. And so far, i am only able to calculate stress at some point of temperature.</p>

<p>But now i'm stuck at plotting, because i've never used matlib for plotting, and i hope you can help me.</p>

<pre><code>import sys
from PyQt4 import QtCore, QtGui, uic


qtCreatorFile = "Application.ui"

Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)

class MyApp(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self):
    QtGui.QMainWindow.__init__(self)
    Ui_MainWindow.__init__(self)
    self.setupUi(self)
    self.clcbtn.clicked.connect(self.CalculateStress)
    self.clcbtn_2.clicked.connect(self.CalculateStress1)
    self.clcbtn_3.clicked.connect(self.CalculateStress2)


def CalculateStress(self):
   t = int(self.textEdit.toPlainText())
   lam = 55500000000
   theta = 10
   mu = 26100000000
   alpha = 0.0000222
   str11 = 3
   total_stress = lam * theta + 2 * mu * str11 - (3 * lam + 2 * mu) * alpha * t
   total_stress_string = "The total stress is: " + str(total_stress)
   self.results_window.setText(total_stress_string)


def CalculateStress1(self):
   t = int(self.textEdit.toPlainText())
   lam = 104400000000
   theta = 10
   mu = 82000000000
   alpha = 0.000013
   str11 = 5
   total_stress1 = lam * theta + 2 * mu * str11 - (3 * lam + 2 * mu) * alpha * t
   total_stress_string = "The total stress is: " + str(total_stress1)
   self.results_window.setText(total_stress_string)

def CalculateStress2(self):
   t = int(self.textEdit.toPlainText())
   lam = 5450000000
   theta = 10
   mu = 1480000000
   alpha = 0.0000702
   str11 = 3
   total_stress2 = lam * theta + 2 * mu * str11 - (3 * lam + 2 * mu) * alpha * t
   total_stress_string = "The total stress is: " + str(total_stress2)
   self.results_window.setText(total_stress_string)


if __name__ == "__main__":

app = QtGui.QApplication(sys.argv)
window = MyApp()
window.show()
sys.exit(app.exec_())
</code></pre>