{ "cells": [ { "cell_type": "markdown", "id": "33070195-2d5f-4ee3-b6cb-a658209b1f4d", "metadata": {}, "source": [ "# Basic Plotting\n" ] }, { "cell_type": "markdown", "id": "8f2a265a-5258-47df-9da2-86afb69cf660", "metadata": {}, "source": [ "**BEFORE BEGINNING THIS EXERCISE** - Check that your kernel (upper right corner, above) is `NPL 2023b`. This should be the default kernel, but if it is not, click on that button and select `NPL 2023b`." ] }, { "cell_type": "markdown", "id": "4ef5d835-37b7-4a4a-84c1-8053093f1500", "metadata": {}, "source": [ "_______________\n", "This activity was developed primarily by Cecile Hannay and Jesse Nusbaumer." ] }, { "cell_type": "markdown", "id": "b35face4-1542-4ab0-8f04-8220a00b0086", "metadata": {}, "source": [ "_______________\n", "\n", "For the atmospheric data, we will look at common variables in the atmospheric diagnostics. This notebook covers 3 basic plotting examples:\n", "\n", "Exercise 1: Global lat/lon of surface temperature\n", "\n", "Exercise 2: Zonal mean of short wave cloud forcing\n", "\n", "Exercise 3: Temperature zonal mean with vertical levels\n", "\n", "Some of the plotting in these examples are based on the AMWG diagnostic framework (ADF) and some are natively from the `xarray` functionality. `xarray` will be used for the data I/O, analysis, and some plotting, `matplotlib` and `cartopy` will aid in plotting, and `numpy` for calculations" ] }, { "cell_type": "code", "execution_count": null, "id": "72e6f251-c6ff-4478-adab-783ac1795e34", "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "import cartopy.crs as ccrs\n", "import cartopy.feature as cfeature\n", "import cftime\n", "import matplotlib as mpl\n", "import matplotlib.path as mpath\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import xarray as xr\n", "from matplotlib.gridspec import GridSpec\n", "from matplotlib.lines import Line2D\n", "from mpl_toolkits.axes_grid1 import make_axes_locatable" ] }, { "cell_type": "markdown", "id": "3d56ba02-c652-4a97-a466-d3633e53aeb1", "metadata": {}, "source": [ "The first step is to grab an atmosphere (CAM) history file from your CESM model run" ] }, { "cell_type": "code", "execution_count": null, "id": "20d4eec8-5332-44a5-bd5c-910048c5d95f", "metadata": {}, "outputs": [], "source": [ "# Set your username here:\n", "username = \"PUT_USER_NAME_HERE\"\n", "\n", "# Here we point to the archive directory from your b.day2.1 simulation\n", "monthly_output_path = f\"/glade/scratch/{username}/archive/b.day2.1/atm/hist\"\n", "\n", "# If you were unable to successfully run the b.day2.1 simulation, then feel free to use\n", "# this provided simulation data instead:\n", "#monthly_output_path = \"/glade/p/cesm/tutorial/tutorial_2023_archive/b.day2.1/atm/hist\"\n", "\n", "# Name of history file to plot\n", "file_name = \"b.day2.1.cam.h0.0003-07.nc\"\n", "\n", "files = os.path.join(monthly_output_path, file_name)\n", "files" ] }, { "cell_type": "code", "execution_count": null, "id": "fa978aa8-bf89-4971-a59b-ae2fafb9e0a5", "metadata": {}, "outputs": [], "source": [ "ds = xr.open_dataset(files)\n", "ds" ] }, { "cell_type": "markdown", "id": "39d93758-aedb-42ab-810c-257a37dae487", "metadata": {}, "source": [ "_______________\n", "## Exercise 1: Make a lat-lon plot of TS\n", "\n", "To highlight plotting the variables from the CESM atmosphere (CAM) file, the first example will plot a simple global lat/lon plot of surface temperature `TS`" ] }, { "cell_type": "markdown", "id": "1e6b83ad", "metadata": {}, "source": [ "### Grab data from first time stamp\n", "\n", "NOTE: This dataset has only one time" ] }, { "cell_type": "code", "execution_count": null, "id": "feb6d347-cbcb-407c-bb4d-6d89c69fcf32", "metadata": {}, "outputs": [], "source": [ "ts_0 = ds.TS.sel({\"time\": ds.TS.time.values[0]}).squeeze()\n", "ts_0" ] }, { "cell_type": "markdown", "id": "cf1a965c", "metadata": {}, "source": [ "Next is to set up the map. Since we are plotting a global lat/lon, we will use the Plate Carree projection. " ] }, { "cell_type": "code", "execution_count": null, "id": "7b183aba-6eae-48ad-9545-f3c918fb99ff", "metadata": {}, "outputs": [], "source": [ "# define the colormap\n", "# cmap = plt.cm.get_cmap('jet')\n", "cmap = mpl.colormaps[\"jet\"]\n", "\n", "# set up the figure with a Plate Carree projection\n", "fig = plt.figure(figsize=(15, 10))\n", "\n", "ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())\n", "\n", "# Plot the first timeslice of TS\n", "img = ax.pcolormesh(ds.lon, ds.lat, ts_0, cmap=cmap, transform=ccrs.PlateCarree())\n", "\n", "plt.title(\"Surface Temperature\", fontsize=20)\n", "\n", "# Set up colorbar\n", "plt.colorbar(img, orientation=\"vertical\", fraction=0.0242, pad=0.01)\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "ccd1f942-a16d-490b-98e6-5f57e92a1cce", "metadata": {}, "source": [ "
\n", "
\n", "Click here for the solution
\n", "\n", "![plot example](../../../images/diagnostics/cam/basics_plot_1.png)\n", "\n", "*

Figure: Plotting solution.

*\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "1bedaea9-73cf-4011-b928-e8c2de752737", "metadata": {}, "source": [ "**Question:**\n", "\n", "The colorbar limits are set automatically by `pcolormesh`. How could you change the arguments for the `pcolormesh` function to set the plotting limits?" ] }, { "cell_type": "markdown", "id": "e18f7699-44a7-46f9-9503-1d97fb9418f7", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "Choose a maximum temperature of 300K and minimum temperature of 225K.\n", " \n", "```python\n", "img = ax.pcolormesh(ds.lon, ds.lat, ts_0, vmax=300, vmin=225, cmap=cmap, transform=ccrs.PlateCarree())\n", "\n", "```\n", " \n", "
\n", "
\n" ] }, { "cell_type": "markdown", "id": "20dc7be8", "metadata": {}, "source": [ "**Question:**\n", "\n", "How could we change the central longitude?" ] }, { "cell_type": "markdown", "id": "26a14d27-a027-4774-87bf-63712f1f88b6", "metadata": {}, "source": [ "\n", "\n", "
\n", "
\n", "\n", " Click here for hints \n", "The default central longitude is 0. Try setting it to 180. Then try other values from 0-360.\n", "\n", "```python\n", "ax = fig.add_subplot(1,1,1, projection=ccrs.PlateCarree(central_longitude=180))\n", "```\n", " \n", "
\n", "
\n" ] }, { "cell_type": "markdown", "id": "c632aed7", "metadata": {}, "source": [ "A second quick example is for `xarray`'s built-in plotting which uses the `matplotlib` and `cartopy` in the background. `xarray` makes a basic plot fairly simple." ] }, { "cell_type": "code", "execution_count": null, "id": "6f48694b-1eae-4b88-87b3-9aec97ed7ffe", "metadata": {}, "outputs": [], "source": [ "# Xarray native plotting\n", "\n", "# Set up figure and axis\n", "fig, ax = plt.subplots(1, figsize=(20, 10))\n", "\n", "# Plot the data straight from the xarray dataset\n", "ts_0.plot.contourf(cmap=\"jet\", levels=np.arange(220, 321, 5))\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "c47469f3-3b57-41c9-9bb2-f56a295bf027", "metadata": {}, "source": [ "
\n", "
\n", "Click here for the solution
\n", "\n", "![plot example](../../../images/diagnostics/cam/basics_plot_2.png)\n", "\n", "*

Figure: Plotting solution.

*\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "8d12294c-691b-491f-bf88-be4c267a5c73", "metadata": {}, "source": [ "---" ] }, { "cell_type": "markdown", "id": "42b295a0-4675-4d4e-814f-5aac53b90973", "metadata": {}, "source": [ "## Exercise 2: Zonal plot of SWCF\n", "\n", "The second example will plot the short wave cloud forcing `SWCF` zonally." ] }, { "cell_type": "markdown", "id": "765089ca", "metadata": {}, "source": [ "Grab the variable data and mean over the the lon value" ] }, { "cell_type": "code", "execution_count": null, "id": "801cf760-f576-4cea-9dd6-0dadfc1788a1", "metadata": {}, "outputs": [], "source": [ "ds_swcf = ds.SWCF\n", "\n", "# Get all the dataset dimensions\n", "d = ds_swcf.dims\n", "\n", "# Grab all dimensions to mean the lon values from\n", "davgovr = [dim for dim in d if dim not in (\"lev\", \"lat\")]\n", "\n", "# Make new dataset of zonal mean values\n", "ds_swcf_zonal = ds_swcf.mean(dim=davgovr)\n", "\n", "# print some values of new zonally-averaged SWCF variable\n", "ds_swcf_zonal" ] }, { "cell_type": "code", "execution_count": null, "id": "b92a7bdd-b2dc-4a2c-a6e9-9b75e361492a", "metadata": {}, "outputs": [], "source": [ "# Create figure and axis\n", "fig, ax = plt.subplots(1, figsize=(12, 7))\n", "\n", "# Set Main title for subplots:\n", "plt.title(\"Short Wave Cloud Forcing\", fontsize=20)\n", "\n", "# Plot value on y-axis and latitude on the x-axis\n", "ax.plot(ds_swcf_zonal.lat, ds_swcf_zonal, c=\"goldenrod\")\n", "\n", "ax.set_xlim(\n", " [max([ds_swcf_zonal.lat.min(), -90.0]), min([ds_swcf_zonal.lat.max(), 90.0])]\n", ")\n", "\n", "ax.set_xlabel(\"Latitude\")\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "47ccd4c3-3c40-4b61-9ac1-3df14249eed1", "metadata": {}, "source": [ "
\n", "
\n", "Click here for the solution
\n", "\n", "![plot example](../../../images/diagnostics/cam/basics_plot_3.png)\n", "\n", "*

Figure: Plotting solution.

*\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "a4cd24f4", "metadata": {}, "source": [ "**Question**\n", "\n", "What code could you add to set a legend for plot line?" ] }, { "cell_type": "markdown", "id": "afcc9ee3-0312-4440-b720-a547382a960a", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "enter the following lines after the `ax.set_xlabel` command and before the `plt.show()` command. \n", " \n", "```python\n", "label = ds_swcf.time.values[0].strftime() # -> '0001-02-01 00:00:00'\n", "line = Line2D([0], [0], label=label,\n", " color=\"blue\")\n", " \n", "fig.legend(handles=[line],bbox_to_anchor=(-0.15, 0.15, 1.05, .102),loc=\"right\",\n", " borderaxespad=0.0,fontsize=16,frameon=False)\n", "```\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "dbe1163c-0ec0-4f9e-94df-4163078c8803", "metadata": {}, "source": [ "**Question**\n", "\n", "What else could you label the line legend, if anything?\n" ] }, { "cell_type": "markdown", "id": "a5cc83e2-3385-472f-864a-88307c6195c2", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "Try setting the label value to something else like your simulation run name, the season or month, etc.\n", " \n", "```\n", "label = 'Season '\n", "```\n", "\n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "d7018dc2-c95b-4643-b078-d5033a6f236e", "metadata": {}, "source": [ "**Question**\n", "\n", "How can you change the color on the plot and the legend?" ] }, { "cell_type": "markdown", "id": "3bfc85e8-831b-4ead-a5e9-aa25ce2194ff", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "To change colors, try a different named color (e.g. \"red\" or \"goldenrod\"). You should make sure both the plot and the legend match or your plot won't make sense.\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "55a42e67-2609-4f07-8485-bc8f5035e14a", "metadata": {}, "source": [ "
\n", "
\n", "Click here for a solution
\n", "\n", "![plot example](../../../images/diagnostics/cam/basics_plot_4.png)\n", "\n", "*

Figure: Plotting solution.

*\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "4d50620e-407d-44ef-bce5-e76c076bcbcd", "metadata": {}, "source": [ "---" ] }, { "cell_type": "markdown", "id": "49402bdd-648e-4021-af0e-9280067b7d76", "metadata": {}, "source": [ "## Exercise 3: Plot of zonal T\n", "\n", "This example will plot the 3D zonal mean of temperature `T` with the pressure as the y-variable and latitude as the x-variable. We are showing you four different ways to make the same plot since each is valuable for plots with pressure on the y-axis and how to format those to get more information from the data.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "619d661b-84c9-4a5f-8366-36d8023f082e", "metadata": {}, "outputs": [], "source": [ "# Remove all dimensions of length one\n", "ds_t = ds.T.squeeze()\n", "ds_t" ] }, { "cell_type": "markdown", "id": "3eee4a65-9094-41e6-b905-b6623d62bde4", "metadata": {}, "source": [ "### Plot 1: Natively via xarray\n", "\n", "This plot uses the xarray native grids for the plot\n", "\n", " - y-axis is increasing with height\n", " - y-axis is not in log pressure" ] }, { "cell_type": "code", "execution_count": null, "id": "5d7c3b5c-96ec-4da6-af39-7c4460827f71", "metadata": {}, "outputs": [], "source": [ "# Average over all dimensions except `lev` and `lat`.\n", "d = ds_t.dims\n", "davgovr = [dim for dim in d if dim not in (\"lev\", \"lat\")]\n", "\n", "DS = ds_t.mean(dim=davgovr)\n", "DS.transpose(\"lat\", \"lev\", ...)\n", "fig, ax = plt.subplots(1, figsize=(20, 10))\n", "DS.plot.contourf(ax=ax, y=\"lev\", cmap=\"Spectral_r\")\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "5324e5a3-c6b4-4213-bf11-6184338a63e2", "metadata": {}, "source": [ "
\n", "
\n", "Click here for a solution
\n", "\n", "![plot example](../../../images/diagnostics/cam/basics_plot_5.png)\n", "\n", "*

Figure: Plotting solution.

*\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "9b8a57a1-0e26-4740-8182-bf4da973c911", "metadata": {}, "source": [ "### Plot 2: Quick ADF style\n", "\n", "This plot uses the quick style of the AMWG Diagnostic Framework (ADF) packages.\n", "\n", " - y-axis is increasing with height\n", " - y-axis is not in log pressure" ] }, { "cell_type": "code", "execution_count": null, "id": "2440adfe-60ab-4feb-832c-496423057404", "metadata": {}, "outputs": [], "source": [ "# Average over all dimensions except `lev` and `lat`.\n", "d = ds_t.dims\n", "davgovr = [dim for dim in d if dim not in (\"lev\", \"lat\")]\n", "\n", "DS = ds_t.mean(dim=davgovr)\n", "\n", "lev = DS[\"lev\"]\n", "lat = DS[\"lat\"]\n", "mlev, mlat = np.meshgrid(lev, lat)\n", "\n", "# Generate zonal plot:\n", "fig, ax = plt.subplots(1, figsize=(15, 7))\n", "\n", "# Create zonal plot with vertical levels\n", "img = ax.contourf(mlat, mlev, DS.transpose(\"lat\", \"lev\"), cmap=\"Spectral_r\")\n", "\n", "# Format axis and ticks\n", "ax.set_xlabel(\"Latitude\")\n", "fig.colorbar(img, ax=ax, location=\"right\")" ] }, { "cell_type": "markdown", "id": "bd0ac9e7-4a8e-498a-be2b-3a7ddd8cca25", "metadata": {}, "source": [ "
\n", "
\n", "Click here for a solution
\n", "\n", "![plot example](../../../images/diagnostics/cam/basics_plot_6.png)\n", "\n", "*

Figure: Plotting solution.

*\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "98f31b9b-db5d-4e2a-81f9-df146980dec0", "metadata": {}, "source": [ "**Questions**\n", "\n", "- What differences do you see between the ADF quick plot and the xarray native plot? \n", "- Why might you want to use one or the other?\n", "- Where, vertically, do high pressures occur and what does this mean for where the ground would be located on this plot?" ] }, { "cell_type": "markdown", "id": "96e8b966-f242-4e43-bb51-9deaa77a6bc6", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "The variable `aice` is actually ice fraction. To convert it to concentration you would need to multipy it by 100. In the rest of these notebooks we use the ice fraction fairly interchangeably with ice concentration. But if you are plotting these you should check your range and see if the maximum value is 1 or 100 because that's important for setting colorbar limits.\n", " \n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "e866346a-2d31-4df9-955c-b7a2ae00b888", "metadata": {}, "source": [ "### Plot 3: ADF style with reversed y-axis\n", "\n", " - y-axis is decreasing with height\n", " - y-axis is not in log pressure" ] }, { "cell_type": "code", "execution_count": null, "id": "c08d64d9-40d9-4064-9b06-2b8489d916a0", "metadata": {}, "outputs": [], "source": [ "# Average over all dimensions except `lev` and `lat`.\n", "d = ds_t.dims\n", "davgovr = [dim for dim in d if dim not in (\"lev\", \"lat\")]\n", "\n", "DS = ds_t.mean(dim=davgovr)\n", "\n", "# print(DS.lev.min(),DS.lev.max())\n", "\n", "lev = DS[\"lev\"]\n", "lat = DS[\"lat\"]\n", "mlev, mlat = np.meshgrid(lev, lat)\n", "\n", "# Generate zonal plot:\n", "fig, ax = plt.subplots(1, figsize=(15, 7))\n", "\n", "# Create zonal plot with vertical levels\n", "img = ax.contourf(mlat, mlev, DS.transpose(\"lat\", \"lev\"), cmap=\"Spectral_r\")\n", "\n", "# Format axis and ticks\n", "plt.gca().invert_yaxis()\n", "ax.tick_params(which=\"minor\", length=4, color=\"r\")\n", "\n", "# Set up colorbar\n", "cbar_ax = fig.add_axes([0, 0, 0.1, 0.1])\n", "posn = ax.get_position()\n", "\n", "# Set position and size of colorbar position: [left, bottom, width, height]\n", "cbar_ax.set_position([posn.x0 + posn.width + 0.005, posn.y0, 0.02, posn.height])\n", "\n", "ax.set_xlabel(\"Latitude\")\n", "fig.colorbar(img, cax=cbar_ax, orientation=\"vertical\")" ] }, { "cell_type": "markdown", "id": "ba0aa084-f95e-4951-81b0-3951e8ed0b29", "metadata": {}, "source": [ "
\n", "
\n", "Click here for a solution
\n", "\n", "![plot example](../../../images/diagnostics/cam/basics_plot_7.png)\n", "\n", "*

Figure: Plotting solution.

*\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "a0beeca6-4697-4bc8-b42d-e43ccceecbef", "metadata": {}, "source": [ "**Question:**\n", "\n", "- What differences do you see on the y-axis between the result from Plot 2 and Plot 3? " ] }, { "cell_type": "markdown", "id": "1dd69767-20ac-49ff-9c1f-ade44886de56", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "The plots are mirror images of each other because the y-axis has been flipped. Plot 2 has the highest pressures at the top of the y-axis while Plot 3 has the highest pressures at the bottom of the y-axis.\n", " \n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "8bd94a75-58cb-4b5d-a806-45b64c26e727", "metadata": {}, "source": [ "**Question:**\n", "\n", "- Where, vertically, do high pressures occur and what does this mean for where the ground would be located on these two figures ?" ] }, { "cell_type": "markdown", "id": "4b1b7ab1-20ff-4745-bad7-cf50c9b807b8", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "The highest pressures in the atmosphere occur at the ground where the most atmospheric mass is pressing downward. This means that Plot 2 is oriented so the location where the ground is is the top of the plot, or up. In Plot 3 the orientation is so that the ground would be at the bottom of the plot, or down. Thus Plot 3 is often more intuitive to read because it's oriented with the way we perceive the atmosphere.\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "84fc1ae8-74f3-4c4f-9171-18b5625f2d96", "metadata": {}, "source": [ "### Plot 4: Complex ADF style\n", "\n", " - y-axis is decreasing with height\n", " - y-axis is in log pressure" ] }, { "cell_type": "code", "execution_count": null, "id": "50564cf7-948e-4b77-9537-707b7358bf71", "metadata": {}, "outputs": [], "source": [ "# Average over all dimensions except `lev` and `lat`.\n", "d = ds_t.dims\n", "davgovr = [dim for dim in d if dim not in (\"lev\", \"lat\")]\n", "\n", "DS = ds_t.mean(dim=davgovr)\n", "\n", "# print(DS.lev.min(),DS.lev.max())\n", "\n", "lev = DS[\"lev\"]\n", "lat = DS[\"lat\"]\n", "mlev, mlat = np.meshgrid(lev, lat)\n", "\n", "# Generate zonal plot:\n", "fig, ax = plt.subplots(1, figsize=(15, 7))\n", "\n", "# Create zonal plot with vertical levels\n", "img = ax.contourf(mlat, mlev, DS.transpose(\"lat\", \"lev\"), cmap=\"Spectral_r\")\n", "\n", "# Format axis and ticks\n", "plt.yscale(\"log\")\n", "plt.gca().invert_yaxis()\n", "ax.tick_params(which=\"minor\", length=4, color=\"r\")\n", "\n", "# Set up colorbar\n", "cbar_ax = fig.add_axes([0, 0, 0.1, 0.1])\n", "posn = ax.get_position()\n", "\n", "# Set position and size of colorbar position: [left, bottom, width, height]\n", "cbar_ax.set_position([posn.x0 + posn.width + 0.005, posn.y0, 0.02, posn.height])\n", "\n", "ax.set_xlabel(\"Latitude\")\n", "fig.colorbar(img, cax=cbar_ax, orientation=\"vertical\")" ] }, { "cell_type": "markdown", "id": "5a8fb095-89fd-4112-9d4f-de5f4ee9f143", "metadata": {}, "source": [ "
\n", "
\n", "Click here for a solution
\n", "\n", "![plot example](../../../images/diagnostics/cam/basics_plot_8.png)\n", "\n", "*

Figure: Plotting solution.

*\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "4d7c9ee8-9445-489f-9b07-3ab67e45398d", "metadata": {}, "source": [ "**Question:**\n", "\n", "- What differences do you see on the y-axis between the result from Plot 3 and Plot 4? " ] }, { "cell_type": "markdown", "id": "f931e791-2f0a-423f-b44b-644686657767", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "The plots both have the y-axis oriented so that the highest pressures, or ground, is at the bottom of the plot. But the scale of the y-axis has changed so that in Plot 3 it is logarithmic.\n", " \n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "6a6af568-90cf-4f8c-a3c8-5dcda30359fd", "metadata": {}, "source": [ "**Question:**\n", "\n", "- What does that mean in terms of which part of the atmosphere are emphasized?" ] }, { "cell_type": "markdown", "id": "0aa7131d-4337-4da2-8b8d-db9a69432142", "metadata": {}, "source": [ "
\n", "
\n", "\n", " Click here for hints \n", "\n", "With the logarithmic y-axis more of the upper atmosphere is shown on the figure. If you wanted to emphasize the boundary layer you might want to change the limits of the figure.\n", " \n", "
\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "8c7c4e8c-4a4a-4f3e-a6d7-4b5e7725a2f7", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "NPL 2023b", "language": "python", "name": "npl-2023b" }, "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": 5 }