{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Specify contour levels \nUse :func:`clfdict()` to create a set of contour levels and contour lines to plot. \n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import pygeode as pyg, numpy as np\nimport pylab as pyl\npyl.ioff()\n\nlat = pyg.regularlat(60)\nlon = pyg.regularlon(120)\n\nz =pyg.sin(2*np.pi*lat/180.)**10 + pyg.cos(10 + (2*np.pi/180.)**2*lat*lon) * pyg.cos(2*np.pi*lat/180.)\n\nax = pyg.plot.AxesWrapper()\n\ncontour_dict = pyg.clfdict(min=-1.2, axes=ax, cdelt=0.4, ndiv=3, nf=2, nl=1, extend='both', cmap='RdGy')\n\npyg.vcontour(z, **contour_dict)\nax.setp(title = 'Using helper function to set up contour levels')\nax.clabel(ax.plots[1], colors='k', fmt='%.1f', fontsize=10, inline=False)\n\npyl.ion()\nax.render()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "``contour_dict`` contains a dictionary of the various plotting parameters\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "print(contour_dict)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "``ax.plots`` contains a list of the various pygeode plot objects\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "print(ax.plots)" ] } ], "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.8.12" } }, "nbformat": 4, "nbformat_minor": 0 }