Skip to content

Latest commit

 

History

History
77 lines (68 loc) · 1.47 KB

File metadata and controls

77 lines (68 loc) · 1.47 KB
jupyter
jupytext kernelspec language_info plotly
notebook_metadata_filter text_representation
all
extension format_name format_version jupytext_version
.md
markdown
1.1
1.1.6
display_name language name
Python 3
python
python3
codemirror_mode file_extension mimetype name nbconvert_exporter pygments_lexer version
name version
ipython
3
.py
text/x-python
python
python
ipython3
3.7.3
description display_as language layout name order page_type permalink thumbnail
How to add images to charts as background images or logos.
advanced_opt
python
base
Horizontal Legends
12
example_index
python/horizontal-legend/
thumbnail/your-tutorial-chart.jpg

Horizontal Legend

import plotly.graph_objects as go

fig = go.Figure()

fig.add_trace(go.Scatter(
    name="First",
    y=[1, 2, 3],
    mode="markers",
    marker=dict(
        size=16,
        color="Crimson"
    ))
)

fig.add_trace(go.Bar(
    name="Second",
    y=[1, 3, 2],
    marker=dict(
        color="LightSeaGreen"
    ))
)

fig.add_trace(go.Scatter(
    name="Third",
    y=[4, 3, 1],
    mode="lines",
    line=dict(
        width=4,
        color="MediumPurple"
    ))
)

fig.update_layout(legend_orientation="h")

fig.show()

Reference

See https://plot.ly/python/reference/#layout-legend-orientation for more information and chart attribute options!