Using Text
Adding Titles and Captions in Plotly
import plotly.express as px
# Sample data
data = {
'Category': ['A', 'B', 'C', 'D'],
'Values': [10, 20, 15, 25]
}
df = pd.DataFrame(data)
# Create a bar chart with titles
fig = px.bar(df, x='Category', y='Values', title='Main Title: Category vs. Values')
fig.update_layout(
xaxis_title='Categories', # X-axis title
yaxis_title='Values', # Y-axis title
title_font=dict(size=24), # Customize title font size
)
fig.show()Example: Adding Annotations
Key Parameters in annotations:
annotations:Notes:
Last updated