{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Contour plot\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import pygeode as pyg, numpy as np\nimport pylab as pyl\n\nlat = pyg.regularlat(60)\nlon = pyg.regularlon(120)\n\nx = pyg.sin(2*np.pi * lon / 180.) * pyg.exp(-(lat - 30)**2 / (2*10**2))\ny = pyg.sin(2*np.pi * lon / 180.) * pyg.exp(-(lat + 40)**2 / (2*10**2))\n\nax = pyg.plot.AxesWrapper()\npyg.vcontour(y, clevs=np.linspace(-1, 1, 21), clines=None, cmap='cool', axes=ax)\npyg.vcontour(x, clevs=None, clines=np.linspace(-1, 1, 21), linewidths = 1., colors='k', axes=ax)\n\nax.setp(title = 'Filled contours and contour lines')\n\npyl.ion()\n\nax.render(1)" ] } ], "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 }