2

When I plot an image, my Navigation toolbar (zoom-in, forward, back...) is invisible. I helped myself with this link: disable matplotlib toolbar. I have first tried:

import matplotlib as mpl mpl.rcParams['toolbar'] = 'toolbar2'

And also checked if in the file itself is set as 'None' but it is not. Did I perhaps forget to install some packages? Even though I don't get any errors.

Is there alternative way to zoom-in and see the coordinates of cursor, because that is all I need.

Edit 1

This is the code which I am using. I copied just the part, where I use plot.

#___plotting part___
import matplotlib as mpl
mpl.rcParams['toolbar'] = 'toolbar2'
import matplotlib.pyplot as plt

plt.ion()
fig, ax = plt.subplots(figsize=(20, 10))
ax.set_title(plot_titel, loc='center', fontname=font_name, fontsize=16, color='black')
ax.set_xlabel('Column number', fontname=font_name, fontsize=16, color='black')
ax.set_ylabel('Mean of raw backscatter', fontname=font_name, fontsize=16, color='black')
ax.plot(range(len(param_image)), param_image, c='black', marker='o')
ax.plot(idx1[0], param_image[idx1], c='red', mec='red', marker='o', linestyle='')
ax.plot(idx2, param_image[idx2], c='blue', mec='blue', marker='o', linestyle='')

ax.grid()
fig.tight_layout()

plt.show()
Community
  • 1
  • 1
Mapa
  • 155
  • 2
  • 12
  • What is your matplotlib version? – mico Jan 16 '16 at 15:32
  • matplotlib version is 1.5.1 – Mapa Jan 16 '16 at 15:40
  • Ok, then it should be compatible at least. Cannot say more, I'm not more familiar with matplotlib. – mico Jan 16 '16 at 15:44
  • Do you have `interactive` set to `True`? `import matplotlib.pyplot as plt; plt.ion()` will do that for you temporarily, or you can modify your `matplotlibrc`. – MattDMo Jan 16 '16 at 16:04
  • Thank you for your respond. The `interactive` was set to `False`, so I changed it, but after running the code, nothing has changed. Therefore I also used `plt.ion()`, but it hasn't worked. Unfortunately I don't have many experiences with `plt.ion()`, so I have provided a code in Edit 1, to see if I used it in a wrong way. – Mapa Jan 16 '16 at 16:42
  • What backend are you using? – tacaswell Jan 16 '16 at 17:15
  • Sorry, but I don't know what do you mean by backend. – Mapa Jan 16 '16 at 17:36

1 Answers1

4

I had the same problem before. uninstall it and then install it again (try to use Anaconda or miniconda distribution to install). for sure after that it will work.

do not mess with matplotlibrc

GeoCom
  • 1,290
  • 2
  • 12
  • 33