{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Add or remove NaturalEarth features\n", "cf. https://www.naturalearthdata.com/downloads" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:23.998667Z", "iopub.status.busy": "2025-01-13T11:30:23.997590Z", "iopub.status.idle": "2025-01-13T11:30:24.528511Z", "shell.execute_reply": "2025-01-13T11:30:24.527911Z" } }, "outputs": [], "source": [ "%matplotlib inline\n", "# for figures in notebook\n", "\n", "# import & initialize epygram\n", "import epygram\n", "epygram.init_env()\n", "\n", "import os\n", "INPUTS_DIR = os.path.join('..', 'inputs')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:24.530814Z", "iopub.status.busy": "2025-01-13T11:30:24.530608Z", "iopub.status.idle": "2025-01-13T11:30:24.564893Z", "shell.execute_reply": "2025-01-13T11:30:24.564400Z" } }, "outputs": [], "source": [ "r = epygram.open(os.path.join(INPUTS_DIR, 'pgd.albachir-07km50.SAND.fa'), 'r')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:24.566967Z", "iopub.status.busy": "2025-01-13T11:30:24.566747Z", "iopub.status.idle": "2025-01-13T11:30:24.611179Z", "shell.execute_reply": "2025-01-13T11:30:24.610732Z" } }, "outputs": [], "source": [ "f = r.readfield('SFX.SAND')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:24.613013Z", "iopub.status.busy": "2025-01-13T11:30:24.612838Z", "iopub.status.idle": "2025-01-13T11:30:25.269811Z", "shell.execute_reply": "2025-01-13T11:30:25.269447Z" } }, "outputs": [], "source": [ "# no coastlines, no borders\n", "fig, ax = f.cartoplot(natural_earth_features=[])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:25.272976Z", "iopub.status.busy": "2025-01-13T11:30:25.272797Z", "iopub.status.idle": "2025-01-13T11:30:29.806419Z", "shell.execute_reply": "2025-01-13T11:30:29.805881Z" } }, "outputs": [], "source": [ "import cartopy.feature as cfeature\n", "# no coastlines, no borders\n", "fig, ax = f.cartoplot(natural_earth_features=[])\n", "# coastlines\n", "ax.add_feature(cfeature.NaturalEarthFeature(category='physical',\n", " name='coastline',\n", " scale='10m',\n", " facecolor='none',\n", " edgecolor='k'))\n", "# roads\n", "ax.add_feature(cfeature.NaturalEarthFeature(category='cultural',\n", " name='roads',\n", " scale='10m',\n", " facecolor='none',\n", " edgecolor='r'))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" } }, "nbformat": 4, "nbformat_minor": 2 }