Skip to content

Commit

Permalink
Plotly
Browse files Browse the repository at this point in the history
  • Loading branch information
gto76 committed Dec 27, 2024
1 parent ce0f8ae commit 87cf504
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3457,7 +3457,7 @@ px.line(df, x='Date', y='Total Deaths per Million', color='Continent').show()
<div id="e23ccacc-a456-478b-b467-7282a2165921" class="plotly-graph-div" style="height:287px; width:935px;"></div>

```python
# $ pip3 install pandas selenium plotly lxml
# $ pip3 install pandas lxml selenium plotly
import pandas as pd, selenium.webdriver, plotly.graph_objects as go


Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment



<div><h4 id="displaysamultiaxislinechartoftotalcoronaviruscasesandchangesinpricesofbitcoindowjonesandgold">Displays a multi-axis line chart of total coronavirus cases and changes in prices of Bitcoin, Dow Jones and gold:</h4><p></p><div id="e23ccacc-a456-478b-b467-7282a2165921" class="plotly-graph-div" style="height:287px; width:935px;"></div><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install pandas selenium plotly lxml</span>
<div><h4 id="displaysamultiaxislinechartoftotalcoronaviruscasesandchangesinpricesofbitcoindowjonesandgold">Displays a multi-axis line chart of total coronavirus cases and changes in prices of Bitcoin, Dow Jones and gold:</h4><p></p><div id="e23ccacc-a456-478b-b467-7282a2165921" class="plotly-graph-div" style="height:287px; width:935px;"></div><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install pandas lxml selenium plotly</span>
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd, selenium.webdriver, plotly.graph_objects <span class="hljs-keyword">as</span> go


Expand Down Expand Up @@ -2848,7 +2848,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
figure = go.Figure()
<span class="hljs-keyword">for</span> col_name <span class="hljs-keyword">in</span> reversed(df.columns):
yaxis = <span class="hljs-string">'y1'</span> <span class="hljs-keyword">if</span> col_name == <span class="hljs-string">'Total Cases'</span> <span class="hljs-keyword">else</span> <span class="hljs-string">'y2'</span>
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=<span class="hljs-number">944</span>,
Expand Down

0 comments on commit 87cf504

Please sign in to comment.