public
Created

python display image with non-linear axes

  • Download Gist
log pcolor.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14
import matplotlib.pyplot as plt
import numpy as np
 
x = np.logspace(1, 3, 5)
y = np.linspace(0, 2, 3)
z = np.linspace(0, 1, 4)
Z = np.vstack((z, z))
 
plt.imshow(Z, extent=[10, 1000, 0, 1], cmap='gray')
plt.xscale('log')
 
plt.axvline(100, color='red')
 
plt.show()

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.