Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm: show x/y coordinates with matplotlib automatically

If I plot with ipython, I automatically see the x/y coordinates when I move with the mouse over the canvas (see bottom right in screenshot):

import matplotlib.pyplot as plt
import numpy as np

my_random = np.random.random(5)
plt.plot(my_random)
plt.show()

How can the same achieved with Pycharm (my plots appear in the SciView toolwindow)?

If not: is there perhaps an easy workaround for it? (and do I have more possibilities if the plot does not appear in the SciView toolwindow?)

x/y coordinates depicted at bottom right


1 Answers

using TkAgg it works:

import matplotlib   
matplotlib.use('TkAgg')
import numpy as np
import matplotlib.pyplot as plt

my_random = np.random.random(5)
plt.plot(my_random)
plt.show()