Show matplotlib plot in rqt
I have a plot in matplotlib, which I am using to control the robot. I have plt.connect('motion_notify_event', self.moveRobot)
function, which controls the robot. Below is the code snippet:
import matplotlib
from matplotlib import cm
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_xlim((xmin, xmax))
ax.set_ylim((ymin, ymax))
fig.canvas.draw()
fig.tight_layout()
fig.canvas.draw()
plt.connect('button_press_event',self.mouseClick)
plt.connect('motion_notify_event', self.moveRobot)
plt.show()
I want to see this plot inside rqt. Any suggestions, please?