{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Subplot\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The periodic table can be attached as a subplot by specifying the `row` and\n`col` arguments.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis\n\n\nelements = list(ptvis.Element) * 2\nradii = [1]*len(ptvis.Element) + [2]*len(ptvis.Element)\n\nfig = plotly.graph_objects.Figure()\nfig.set_subplots(rows=2, cols=1)\nfig.add_scatter(x=[0], y=[0], row=1, col=1) # for ease of viewing\nptvis.attach_polar_bar_cells(fig, elements, radii, row=2, col=1)\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 }