When we need to plot data in logarithmic form then we can use an inbuilt defined function matplotlib pyplot yscale log. Subplots 2 2 log y axis ax1. Grid log x axis ax2.