Ask Your Question
0

Show matplotlib plot in rqt

asked 2017-11-10 05:11:41 -0500

Ravi Joshi gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-17 23:44:10 -0500

Ravi Joshi gravatar image

I am able to do it by following this tutorial. Thank you very much.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-11-10 05:11:41 -0500

Seen: 441 times

Last updated: Nov 17 '17