{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Simple\n\nThis demo shows how to use the Python ``plotly`` package under itom.\n\nIn order to show plotly outputs in itom figures, it is only necessary\nto import the ``itomPlotlyRenderer`` module once at the beginning of your\nscript. This adds an itom specific renderer to Plotly and uses it as default.\n\nThe plotly outputs are then shown in an itom designerPlugin with the name\n``plotlyPlot``.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import itomPlotlyRenderer\n\nimport plotly.express as px\n\ndf = px.data.tips()\nfig = px.bar(df, x='sex', y='total_bill', facet_col='day', color='smoker', barmode='group',\n template='presentation+plotly'\n )\nfig.update_layout(height=400)\nfig" ] } ], "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.10" } }, "nbformat": 4, "nbformat_minor": 0 }