I am trying to plot some curves using matplotlib using the default gui component and you have a specific problem to choose which of the two y-axes to select with the mouse. The situation with the position seems to be that ax2 is selected, but instead I would like to use ax1. Can this be fixed in some simple way?
This is the code I'm currently using to plot my curves.
Best regards Anders Olme
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, patches) = 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(bins, mean, sigma) ax2.plot(bins, y, 'r-', linewidth=1) ax1.set_xlabel('Measvlues') ax2.set_ylabel('Probability') ax1.set_title(r'$\mathrm{Histogram\ of\ measvalues:}\ \mu=$'+str(mean)+r'$,\ \sigma=$'+str(sigma)+r'$$') plt.grid(True) plt.show()
source share