Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cimport cython | |
import numpy as np | |
cimport numpy as np | |
cdef extern from 'math.h': | |
float exp(float x) | |
float cos(float x) | |
float sin(float x) | |
float fabs(float x) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from mpl_toolkits.basemap import Basemap | |
def draw_map_background(m, ax): | |
ax.set_axis_bgcolor('#729FCF') | |
m.fillcontinents(color='#FAFAFA', ax=ax, zorder=0) | |
m.drawstates(ax=ax) | |
m.drawcountries(ax=ax) | |
m.drawcoastlines(ax=ax) | |
KM = 1000. | |
clat = 39.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Commit: 8c57e4fe4909815092af470f4a036c80b407382c | |
Traceback (most recent call last): | |
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper | |
draw(artist, renderer, *args, **kwargs) | |
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/figure.py", line 927, in draw | |
func(*args) | |
File "/Users/pmarsh/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper | |
draw(artist, renderer, *args, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
import matplotlib.pyplot as plt | |
x = np.random.rand(10) * 10 | |
y = np.random.rand(10) * 10 | |
plt.fill(x, y, fill=False, hatch='/', linestyle='dashed') | |
plt.savefig('incorrect_example.png') | |
plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.axes_grid1 import axes_divider as divider | |
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredText | |
def add_center_text(ax): | |
pos = ax.get_position().bounds | |
l, b, w, h = pos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def great_circle(lon1, lat1, lon2, lat2): | |
delta = lon2 - lon1 | |
a = np.radians(lat1) | |
b = np.radians(lat2) | |
c = np.radians(delta) | |
x = np.sin(a) * np.sin(b) + np.cos(a) * np.cos(b) * np.cos(c) |