Please consider my attached examples. hw3.py 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 hw3.py I do multiple plots of desired unit (e.g. wavelength to wavenumber etc…) I am quite sure that the units shown in the hw3.py are correctly converted. Now I am planning to produce these conversions with mpl transformations. Then test1-hw3.py 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 hw3.py as shown below:
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)
line1, = parx.plot(1/(wavelength[1:]*100), np.ones(len(wavelength[1:])))
hw3.py (8.54 KB)
test1-hw3.py (2.33 KB)