python - Matplotlib with dual scale mouse over -


I use the default GUI component to plot some curves with matplotlib and try some trouble to select which of the two y axes That mouse should be selected on the functionality Default case It seems that ax2 has been selected, but I would like to use ax1 instead, is it possible to fix it in a few easy ways?

This code I use at this time is plotting my curves.

Regards Anders Olm

  delta = np.median (np diff (measurementvalues.measvalues) myscale = 10 myrange = (measurementvalues.lowerlimit - delta * myscale, measurementvalues .upperlimit + delta * myscale) figure = plt.figure () AX1 = figure.add_subplot (111) (n, bins, patch) = ax1.hist (measurementvalues.measvalues, 10, range = myrange, normed = 0, facecolor = 'Green', alpha = 0.75) AX2 = ax1.twinx () mean = np.average (measurementvalues.measvalues) sigma = np .std (measurementvalues.measvalues) y = mlab.normpdf (cans, mean, sigma) ax2 Plot (bins, y, 'r-', linewidth = 1) ax1.set_xlabel ('Measvlues') ax2.set_ylabel ('probability') ax1.set_title (r '$ \ mathrm {\ measvalues' histogram Plate.grid (true) plt.show ()  

add the following twinx after calling

  ax3 = Ax1.figure.add_axes (ax1.get_positi) on (true), share x = axis 1, sharey = axis 1, framing = false) ax3.xaxis.set_visible (false) ax3.yaxis.set_visible (false)  

You also have to change Plt.grid (True) ax1.grid (True)


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -