From 87cf50423366c545e82120e2c9957b07ac03f6cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 27 Dec 2024 17:35:13 +0100 Subject: [PATCH] Plotly --- README.md | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8d3d95d..a9dcb74 100644 --- a/README.md +++ b/README.md @@ -3457,7 +3457,7 @@ px.line(df, x='Date', y='Total Deaths per Million', color='Continent').show()
```python -# $ pip3 install pandas selenium plotly lxml +# $ pip3 install pandas lxml selenium plotly import pandas as pd, selenium.webdriver, plotly.graph_objects as go @@ -3500,7 +3500,7 @@ def display_data(df): figure = go.Figure() for col_name in reversed(df.columns): yaxis = 'y1' if col_name == 'Total Cases' else 'y2' - trace = go.Scatter(x=df.index, y=df[col_name], name=col_name, yaxis=yaxis) + trace = go.Scatter(x=df.index, y=df[col_name], yaxis=yaxis, name=col_name) figure.add_trace(trace) figure.update_layout( width=944, diff --git a/index.html b/index.html index eeb2d0e..9adf4a2 100644 --- a/index.html +++ b/index.html @@ -2805,7 +2805,7 @@ px.line(df, x='Date', y=Displays a multi-axis line chart of total coronavirus cases and changes in prices of Bitcoin, Dow Jones and gold:

# $ pip3 install pandas selenium plotly lxml
+

Displays a multi-axis line chart of total coronavirus cases and changes in prices of Bitcoin, Dow Jones and gold:

# $ pip3 install pandas lxml selenium plotly
 import pandas as pd, selenium.webdriver, plotly.graph_objects as go
 
 
@@ -2848,7 +2848,7 @@ px.line(df, x='Date', y=for col_name in reversed(df.columns):
         yaxis = 'y1' if col_name == 'Total Cases' else 'y2'
-        trace = go.Scatter(x=df.index, y=df[col_name], name=col_name, yaxis=yaxis)
+        trace = go.Scatter(x=df.index, y=df[col_name], yaxis=yaxis, name=col_name)
         figure.add_trace(trace)
     figure.update_layout(
         width=944,