{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Line 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\nt = pyg.ModelTime365(values = np.arange(100), units='days', startdate=dict(year=1, month=1))\ny1 = pyg.exp(-t / 30.) * pyg.cos(2*np.pi * t / 20.)\ny2 = pyg.exp(-t / 30.) * pyg.sin(2*np.pi * t / 20.)\ny1 = y1.rename('y1')\ny2 = y2.rename('y2')\n\npyl.ioff()\nax = pyg.plot.AxesWrapper()\npyg.vplot(y1, label='y1', c='r', lw=2, axes=ax)\npyg.vplot(y2, label='y2', c='b', lw=2, axes=ax)\n\nax.setp(title = 'Two lines', ylabel='')\nax.setp_xaxis(major_formatter=pyg.timeticker.TimeFormatter(t, '$b'))\n\nax.legend(loc='lower right', frameon=False)\n\npyl.ion()\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 }