{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# ASCII plotting\n", "\n", "**Note: For this notebook to work properly, you need to install the `xtermcolor` package.**" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from physt import examples\n", "from physt import plotting\n", "plotting.set_default_backend(\"ascii\")\n", "\n", "import numpy as np\n", "np.random.seed(42)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "#\n", "####\n", "#############\n", "#######################\n", "#######################\n", "############\n", "####\n", "#\n", "\n" ] } ], "source": [ "examples.normal_h1().plot()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 4.48 →\n", "+----------+\n", "|██████████|3.69 ↑\n", "|██████████|\n", "|██████████|\n", "|██████████|\n", "|██████████|\n", "|██████████|\n", "|██████████|\n", "|██████████|\n", "|██████████|\n", "|██████████|-3.66 ↓\n", "+----------+\n", "← -3.86\n", "\n", "↓ 0\n", "████████████\n", " 879 ↑\n" ] } ], "source": [ "examples.normal_h2().plot(cmap='Greys_r')" ] }, { "cell_type": "code", "execution_count": null, "outputs": [], "source": [], "metadata": { "collapsed": false } } ], "metadata": { "anaconda-cloud": {}, "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.9.5" } }, "nbformat": 4, "nbformat_minor": 2 }