Advanced chart styling
Contents
Advanced chart styling#
Let’s start with our standard stock data.
import plotly.express as px
df_stocks = px.data.stocks()
df_stocks.tail()
date | GOOG | AAPL | AMZN | FB | NFLX | MSFT | |
---|---|---|---|---|---|---|---|
100 | 2019-12-02 | 1.216280 | 1.546914 | 1.425061 | 1.075997 | 1.463641 | 1.720717 |
101 | 2019-12-09 | 1.222821 | 1.572286 | 1.432660 | 1.038855 | 1.421496 | 1.752239 |
102 | 2019-12-16 | 1.224418 | 1.596800 | 1.453455 | 1.104094 | 1.604362 | 1.784896 |
103 | 2019-12-23 | 1.226504 | 1.656000 | 1.521226 | 1.113728 | 1.567170 | 1.802472 |
104 | 2019-12-30 | 1.213014 | 1.678000 | 1.503360 | 1.098475 | 1.540883 | 1.788185 |
Templates#
Documentation:
https://plotly.com/python/templates/
Template options:
plotly
, plotly_white
, plotly_dark
, ggplot2
, seaborn
, simple_white
, none
# normal
stock_fig = px.line(
data_frame=df_stocks,
x='date',
y=['GOOG', 'AAPL'],
)
stock_fig