[Matplotlib-users] Plot problem with pyqtmatplotlib

Hello i have done this and works:

def prova(self):
lista_r =
lista_y =
for a in range(40):
val = self.tableWidget.item(a, 0)
va = QTableWidgetItem(val)
valdamettere = va.text()
if valdamettere != ‘’:
lista_r.append(valdamettere)
print(lista_r)
lista_y =
for a in range(40):
val = self.tableWidget.item(a, 1)
va = QTableWidgetItem(val)
valdamettere = va.text()
if valdamettere != ‘’:
lista_y.append(valdamettere)
figure = Figure(figsize=(9.18, 6.25), dpi=55)
axes = figure.gca()
axes.set_title(“Andamento Profilato”)
lista_r_mp =
lista_y_mp =
for a in range(len(lista_r)-1):
print(float(lista_r[a]), float(lista_r[a+1]))
test_r = np.linspace(float(lista_r[a]), float(lista_r[a+1]))
lista_r_mp.append(test_r)
for b in range(len(lista_y)-1):
test_y = np.linspace(float(lista_y[b]), float(lista_y[b+1]))
lista_y_mp.append(test_y)
for c in range(len(lista_y_mp)):
axes.plot(lista_r_mp[c], lista_y_mp[c])
axes.grid(True)
axes.set_xlabel(‘Raggio’)
axes.set_ylabel(‘Y’)
canvas = FigureCanvas(figure)
self.navi_toolbar = NavigationToolbar(canvas, self)
self.vbl_one = QVBoxLayout(self.widget_3)
self.vbl_one.addWidget(canvas)
self.vbl_one.addWidget(self.navi_toolbar)

All this works

now i need to add to the same figure an old script

def test(self):
import numpy as np
import warnings
import matplotlib.pyplot as plt
x = np.array([10, 20, 30, 40, ])
y = np.array([50, 60, 70, 80])#raggio
print(x, y)
p= np.poly1d(355)
with warnings.catch_warnings():
warnings.simplefilter(‘ignore’, np.RankWarning)
p30 = np.poly1d(np.polyfit(x, y, 50))
valore_y_da_mettere = p30(355)
print(‘p30 di 500/n’)
print(valore_y_da_mettere)
self.lineEdit_2.setText(str(valore_y_da_mettere))
xp = np.linspace(0, 100, 100000)
_ = plt.plot(x, y, ‘.’, xp, p30(xp), ‘-’)
plt.ylim(50,80)#limiti asse y
plt.xlim(10, 40)# limiti asse x
plt.show()

How i can add the test plot on the same figure of the function prova??
basically how i can change the plt in the figure.gca()