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
| seas_mask = (elevation < sea_level).astype(int) | |
| sea_labels = skimage.measure.label(seas_mask, connectivity=1) # try plotting this with matplotlib, useful | |
| sea_nos, sea_sizes = np.unique(sea_labels, return_counts=True) | |
| sea_nos, sea_sizes = sea_nos[1:], sea_sizes[1:] # remove land, which has label 0 | |
| seas = zip(sea_sizes, sea_nos)[::-1] # sort, largest size first | |
| for sea_size, sea_no in seas: | |
| print("Sea with label", sea_no, "has size", sea_size) | |
| # do something to each sea, modify map, etc. |
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
| \begin{figure} | |
| \centering | |
| \begin{tikzpicture} | |
| \begin{axis}[ | |
| scale only axis, | |
| no markers, | |
| domain=0:2*pi, | |
| samples=100, | |
| axis lines=center, | |
| axis line style={-}, |
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.