Instantly share code, notes, and snippets.

What would you like to do?
import numpy as np
import matplotlib.pyplot as plt
# Create x and y axis
x, y = np.arange(-99, 100), np.arange(-99, 100)
# Turn 1D arrays into 2D with array broadcasting
distance = np.sqrt(x**2 + y[:, np.newaxis]**2)
# print(distance)
# Plot it baby oh yeah!
plt.pcolor(x, y, distance)
plt.axis(x.min(), x.max(), y.min(), y.max())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment