Skip to content

Commit 0e3caa2

Browse files
committed
Add code using plotly
1 parent 294d461 commit 0e3caa2

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ channels:
33
- conda-forge
44
dependencies:
55
- python=3.11
6-
- matplotlib
6+
- plotly

index.ipynb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
{
44
"cell_type": "raw",
55
"id": "6a68545b-f14c-46af-8fd5-3a303710ddd2",
6-
"metadata": {},
6+
"metadata": {
7+
"vscode": {
8+
"languageId": "raw"
9+
}
10+
},
711
"source": [
812
"---\n",
9-
"title: \"Minimal Example of Tutorial in Jupyter Notebook (using Quarto Markdown) with Python\"\n",
13+
"title: \"Minimal Example of Tutorial in Jupyter Notebook (using Quarto Markdown) with Python and Plotly\"\n",
1014
"author: Raniere Silva\n",
1115
"image: img/cover.jpg\n",
1216
"image-alt: Green snake.\n",
@@ -129,7 +133,9 @@
129133
"id": "d407a703",
130134
"metadata": {},
131135
"source": [
132-
"## Creation of figure with Python"
136+
"## Creation of figure with Python\n",
137+
"\n",
138+
"The next code was sourced from [Plotly's documentation](https://plotly.com/python/line-and-scatter/)."
133139
]
134140
},
135141
{
@@ -139,10 +145,10 @@
139145
"metadata": {},
140146
"outputs": [],
141147
"source": [
142-
"import random\n",
143-
"import matplotlib.pyplot as plt\n",
144-
"\n",
145-
"plt.plot([random.randint(0, 9) for x in range(10)])"
148+
"import plotly.express as px\n",
149+
"df = px.data.iris() # iris is a pandas DataFrame\n",
150+
"fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\")\n",
151+
"fig.show()"
146152
]
147153
},
148154
{

0 commit comments

Comments
 (0)