Skip to content

Instantly share code, notes, and snippets.

@KerryHalupka
Last active July 25, 2020 02:43
Show Gist options
  • Save KerryHalupka/343009017a41d4c48be6e65a50d2f4b1 to your computer and use it in GitHub Desktop.
Save KerryHalupka/343009017a41d4c48be6e65a50d2f4b1 to your computer and use it in GitHub Desktop.
example imshow, default colormap
import numpy as np
import matplotlib.pyplot as plt
x, y = np.mgrid[-5:5:0.05, -5:5:0.05]
z = (np.sqrt(x**2 + y**2) + np.sin(x**2 + y**2))
fig, ax = plt.subplots(1,1)
im = ax.imshow(z)
fig.colorbar(im)
ax.yaxis.set_major_locator(plt.NullLocator()) # remove y axis ticks
ax.xaxis.set_major_locator(plt.NullLocator()) # remove x axis ticks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment