<jupyter_start><jupyter_text>Plotting Pandapower Networks using PlotlyThis tutorial shows you how to make interactive plots of pandapower networks using plotly (https://plot.ly/python/).The best way to get started is to get familiar with 3 built-in plots that correspond to:* a simple plot of a network (respect switch statuses by default)* voltage-levels plot - colores and labels network according to voltage levels* Power Flow results - a colormap plot where buses are colored according to voltage magnitudes and branches according to line/transformer loading.The following sample plots are with mv_oberrhein network from the pandapower.networks package:<jupyter_code>from pandapower.plotting.plotly import simple_plotly
from pandapower.networks import mv_oberrhein
from pandapower import runpp
net = mv_oberrhein()
runpp(net)<jupyter_output><empty_output><jupyter_text>Simple plottingA simple network plot wich labels as separate trace all network buses, lines, transformers and external grid.Try some of the fancy plotly features from the upper-right corner:* zooming,* hoover tool (position cursor on the bus/line/trafo to get basic info),* selecting, * click on the legend to hide-show any of the legened elements,<jupyter_code>simple_plotly(net)<jupyter_output><empty_output><jupyter_text>Voltage levelsPlots a network colored and layered according to voltage levels.<jupyter_code>from pandapower.plotting.plotly import vlevel_plotly
vlevel_plotly(net)
from pandapower.networks import create_cigre_network_hv
net = create_cigre_network_hv()
runpp(net)
vlevel_plotly(net)<jupyter_output><empty_output><jupyter_text>Power Flow ResultsResults from `res_bus`, `res_line` and `res_trafo` can be effectively displayed using `pf_res_plolty`.Buses colored according to resulting voltage magnitude using colormap in range $[0.9,1.1]$.  Lines and trafos are colored according to resulting loading using colormap in range $[0,100]$.  Positioning a cursor over a bus or line-breaks shows more details about each element.<jupyter_code>from pandapower.plotting.plotly import pf_res_plotly
pf_res_plotly(net)<jupyter_output><empty_output><jupyter_text>General Plotting featuresInteractive plots are built to share some general plotting features with static plots using [matplotlib](https://github.com/e2nIEE/pandapower/blob/master/tutorials/plotting_basic.ipynb).    Plots without geodata available<jupyter_code>net = mv_oberrhein()
runpp(net)

# delete the geocoordinates
net.bus_geodata.drop(net.bus_geodata.index, inplace=True)
net.line_geodata.drop(net.line_geodata.index, inplace=True)

simple_plotly(net)<jupyter_output><empty_output><jupyter_text>Figure size and aspect ratio**Aspect ratio** (`aspectratio`) - default aspect ratio of a figure is set to `'auto'` which means keeping aspect ratio proportional to geodata. If `aspectratio=False` figure will be stretch according to window size.<jupyter_code>net.bus_geodata.drop(net.bus_geodata.index, inplace=True)
net.line_geodata.drop(net.line_geodata.index, inplace=True)
pf_res_plotly(net, aspectratio=(1.3,1))<jupyter_output><empty_output><jupyter_text>**Figure Size** (`figsize`) is by default set to 1 and it is used only to multiply total plot size, thus real figure size `figsize=aspectratio*figsize`<jupyter_code>net = mv_oberrhein()
simple_plotly(net, aspectratio=(2,1), figsize=0.5)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0771055753262159, 'fraction_numerical': 0.005338078291814947, 'mean_word_length': 7.267156862745098, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '282424', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1037, 'n_words': 326, 'path': 'tutorials/plotly_built-in.ipynb', 'repo_name': 'thomaswolgast/pandapower', 'size': '3372'}