Skip to content

Instantly share code, notes, and snippets.

@aizquier
Created October 17, 2017 16:40
Show Gist options
  • Save aizquier/bfbd93c0bb49a30bcb21412a75f33bb0 to your computer and use it in GitHub Desktop.
Save aizquier/bfbd93c0bb49a30bcb21412a75f33bb0 to your computer and use it in GitHub Desktop.
Azimuth plot for archaeoastronomy
import matplotlib.pyplot as plt
import numpy as np
# azimuths to plot (degrees)
data = [95, 87, 82, 96, 78, 89, 129, 264, 277, 58]
# convert to radians
azimuths_rad = (np.array(data) * np.pi) / 180.0
# Polar plotting
fig = plt.figure() # Size
plt.grid(color='#888888', linewidth=0.5) # Color the grid
ax = plt.subplot(111, polar=True) # Create subplot
ax.set_theta_direction(-1) # plot clockwise
ax.set_theta_zero_location('N') # Set zero to North
ax.axes.get_yaxis().set_visible(False)
for az in azimuths_rad:
ax.plot([az, az], [0.9, 1.0], color="#000000",linewidth=1)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment