Here is the explanation for the code:
- fig, (ax1, ax2, ax3) = plt.subplots(1, 3) defines the layout of the figure with three axes objects to be plotted in one row.
- On the ax1 axes, a simple line chart is plotted with the x and y axis limits set. Due to the very large range of data, not all the points are clearly visible, and the relative gap between them is not easy to visualize.
- On ax2, a logarithmic scale is demonstrated without any chart in it. ax2.set() sets all the parameters for the plot. xscale="log" and yscale="log" set the x and the y axis to logarithmic scale. aspect=2 sets the ratio of the y-scale data to be twice the size of the x-scale data. As you can see, the distance between 102 to 103 on the y axis is twice ...