Multiple axes related questions


Please consider my attached examples. nicely produces multiple axes electromagnetic spectrum with solar and terrestrial radiation plotted using Planck’s function. However, the major and minor ticks placements are not nice in those plots and I have decided to use the new axis_grid1 interface. In the original I do multiple plots of desired unit (e.g. wavelength to wavenumber etc…) I am quite sure that the units shown in the are correctly converted. Now I am planning to produce these conversions with mpl transformations. Then comes into view once again.

Can someone possibly (JJ) give little hint here as to converting from wavelength to wavenumber using Affine2D and correctly see the ticks located as the main x-axis.

I do lots of extra lines to get this one working properly in the as shown below:

multi x-axes

first wavenumber in cm^-1

parx = ax1.twiny()


offset = 0, -60

new_axisline = parx.get_grid_helper().new_fixed_axis

parx.axis[“bottom”] = new_axisline(loc=“bottom”, axes=parx, offset=offset)


parx.axis[“bottom”].label.set_text(u"Wavenumber, cm⁻¹")


line1, = parx.plot(1/(wavelength[1:]*100), np.ones(len(wavelength[1:])))




Thanks. (8.54 KB) (2.33 KB)