{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Simplest plot, with auto-determined parameters" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:09.424263Z", "iopub.status.busy": "2025-01-13T11:30:09.423749Z", "iopub.status.idle": "2025-01-13T11:30:09.949384Z", "shell.execute_reply": "2025-01-13T11:30:09.948884Z" } }, "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:09.951494Z", "iopub.status.busy": "2025-01-13T11:30:09.951278Z", "iopub.status.idle": "2025-01-13T11:30:10.100935Z", "shell.execute_reply": "2025-01-13T11:30:10.100471Z" } }, "outputs": [], "source": [ "# open resource in read mode\n", "r = epygram.open(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:10.102965Z", "iopub.status.busy": "2025-01-13T11:30:10.102830Z", "iopub.status.idle": "2025-01-13T11:30:10.161103Z", "shell.execute_reply": "2025-01-13T11:30:10.160663Z" } }, "outputs": [], "source": [ "f = r.readfield('SURFTEMPERATURE')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:10.162804Z", "iopub.status.busy": "2025-01-13T11:30:10.162621Z", "iopub.status.idle": "2025-01-13T11:30:10.708685Z", "shell.execute_reply": "2025-01-13T11:30:10.708295Z" } }, "outputs": [], "source": [ "fig, ax = f.cartoplot()\n", "# interactive mode: fig.show()\n", "# file mode: fig.savefig('figure.png')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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": 4 }