Skip to content

Instantly share code, notes, and snippets.

@endolith
Created July 16, 2012 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endolith/3124528 to your computer and use it in GitHub Desktop.
Save endolith/3124528 to your computer and use it in GitHub Desktop.
python display image with non-linear axes
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment