Generally, the electromagnetic spectrum diagram is represented using two variables: the frequency of the wave and the wavelength of the wave. Since there is an inverse proportionality between the two variables, it means that the higher the frequency, the smaller the wavelength (and viceversa), so when they are put together in the diagram their scales go into opposite directions.