pypsa.Network.iplot#
- Network.iplot(fig=None, bus_colors='cadetblue', bus_alpha=1, bus_sizes=10, bus_cmap=None, bus_colorbar=None, bus_text=None, line_colors='rosybrown', link_colors='darkseagreen', transformer_colors='orange', line_widths=3, link_widths=3, transformer_widths=3, line_text=None, link_text=None, transformer_text=None, layouter=None, title='', size=None, branch_components=None, iplot=True, jitter=None, mapbox=False, mapbox_style='open-street-map', mapbox_token='', mapbox_parameters=None)#
Plot the network buses and lines interactively using plotly.
- Parameters:
fig (dict, default None) – If not None, figure is built upon this fig.
bus_colors (dict/pandas.Series) – Colors for the buses, defaults to “cadetblue”. If bus_sizes is a pandas.Series with a Multiindex, bus_colors defaults to the n.carriers[‘color’] column.
bus_alpha (float) – Adds alpha channel to buses, defaults to 1.
bus_sizes (float/pandas.Series) – Sizes of bus points, defaults to 10.
bus_cmap (plt.cm.ColorMap/str) – If bus_colors are floats, this color map will assign the colors
bus_colorbar (dict) – Plotly colorbar, e.g. {‘title’ : ‘my colorbar’}
bus_text (pandas.Series) – Text for each bus, defaults to bus names
line_colors (str/pandas.Series) – Colors for the lines, defaults to ‘rosybrown’.
link_colors (str/pandas.Series) – Colors for the links, defaults to ‘darkseagreen’.
transfomer_colors (str/pandas.Series) – Colors for the transfomer, defaults to ‘orange’.
line_widths (dict/pandas.Series) – Widths of lines, defaults to 1.5
link_widths (dict/pandas.Series) – Widths of links, defaults to 1.5
transformer_widths (dict/pandas.Series) – Widths of transformer, defaults to 1.5
line_text (pandas.Series) – Text for lines, defaults to line names.
link_text (pandas.Series) – Text for links, defaults to link names.
tranformer_text (pandas.Series) – Text for transformers, defaults to transformer names.
layouter (networkx.drawing.layout function, default None) – Layouting function from networkx which overrules coordinates given in
n.buses[['x', 'y']]
. See list of available options.title (string) – Graph title
size (None|tuple) – Tuple specifying width and height of figure; e.g. (width, heigh).
branch_components (list of str) – Branch components to be plotted, defaults to Line and Link.
iplot (bool, default True) – Automatically do an interactive plot of the figure.
jitter (None|float) – Amount of random noise to add to bus positions to distinguish overlapping buses
mapbox (bool, default False) – Switch to use Mapbox.
mapbox_style (str, default 'open-street-map') –
Define the mapbox layout style of the interactive plot. If this is set to a mapbox layout, the argument
mapbox_token
must be a valid Mapbox API access token.- Valid open layouts are:
open-street-map, white-bg, carto-positron, carto-darkmatter, stamen-terrain, stamen-toner, stamen-watercolor
- Valid mapbox layouts are:
basic, streets, outdoors, light, dark, satellite, satellite-streets
mapbox_token (string) – Mapbox API access token. Obtain from https://www.mapbox.com. Can also be included in mapbox_parameters as accesstoken=mapbox_token.
mapbox_parameters (dict) – Configuration parameters of the Mapbox layout. E.g. {“bearing”: 5, “pitch”: 10, “zoom”: 1, “style”: ‘dark’}.
- Returns:
fig
- Return type:
dictionary for plotly figure