A logarithmic colorbar in matplotlib scatter plot

I would like to make the colors of the points on the scatter plot correspond to the value of the void fraction, but on a logarithmic scale to amplify differences. I did this, but now when I do plt.colorbar(), it displays the log of the void fraction, when I really want the actual void fraction. How can I make a log scale on the colorbar with the appropriate labels of the void fraction, which belongs to [0.00001,1]?

How to set xlim and ylim for a subplot in matplotlib

I would like to limit the X and Y axis in matplotlib for a specific subplot. The subplot figure itself doesn’t have any axis property. I want for example to change only the limits for the second plot: import matplotlib.pyplot as plt fig=plt.subplot(131) plt.scatter([1,2],[3,4]) fig=plt.subplot(132) plt.scatter([10,20],[30,40]) fig=plt.subplot(133) plt.scatter([15,23],[35,43]) plt.show() Answers: Thank you for visiting the … Read more