{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Bubble chart\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The areas of cells can be determined by the `areas` argument.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis\n\n\nelements = list(ptvis.Element)\nareas = list(range(len(elements)))\n\nfig = plotly.graph_objects.Figure()\nptvis.attach_plain_cells(fig, elements, areas=areas)\n\nplotly.io.show(fig)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It might be nice to\n`change the cell shape\n` to\n``\"circle\"``.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis\n\n\nelements = list(ptvis.Element)\nareas = list(range(len(elements)))\n\nfig = plotly.graph_objects.Figure()\nptvis.attach_plain_cells(fig, elements, areas=areas, shape=\"circle\")\n\nplotly.io.show(fig)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, a cell with the maximum value of the `areas` argument has the\nlargest possible area. The value corresponding to the largest possible area\ncan be specified by the `area_max` argument.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis\n\n\nelements = list(ptvis.Element)\nareas = list(range(len(elements)))\n\nfig = plotly.graph_objects.Figure()\nptvis.attach_plain_cells(fig, elements, areas=areas, area_max=200)\n\nplotly.io.show(fig)" ] } ], "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.13.3" } }, "nbformat": 4, "nbformat_minor": 0 }