{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "
Title
Text Element
\n", "
Dependencies
Bokeh
\n", "
Backends
Bokeh
Matplotlib
\n", "
\n", "
" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import holoviews as hv\n", "from holoviews import opts\n", "hv.extension('bokeh')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "opts.defaults(opts.Curve(color='#D3D3D3'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The ``Text`` annotation is used to overlay text at a particular position on a plot:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "xs = np.linspace(-5,5,100)\n", "hv.Curve((xs,-(xs-2)**2)) * hv.Text(0, -30, 'Quadratic Curve')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For full documentation and the available style and plot options, use ``hv.help(hv.Text).``" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 2 }