Skip to content

Commit cf165e1

Browse files
committed
correct some stuff on the connected scatter section
1 parent 9e9ffc0 commit cf165e1

File tree

5 files changed

+56
-47
lines changed

5 files changed

+56
-47
lines changed

src/notebooks/132-basic-connected-scatterplot.ipynb

Lines changed: 34 additions & 28 deletions
Large diffs are not rendered by default.

src/pages/connected-scatter-plot.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@ import Spacing from "../components/Spacing";
1616
const chartDescription =
1717
"<p>A <a href='https://www.data-to-viz.com/graph/connectedscatter.html'>connected scatterplot</a> is a <a href='https://python-graph-gallery.com/line-chart/'>line chart</a> where each data point is shown by a circle or any type of marker. This section explains how to build a connected scatterplot with <code>Python</code>, using both the <code>Matplotlib</code> and the <code>Seaborn</code> libraries.</p>";
1818

19-
const quickCode = `# library
20-
import seaborn as sns
21-
import pandas as pd
22-
import numpy as np
23-
24-
# Create a dataset
25-
df = pd.DataFrame(np.random.random((5,5)), columns=["a","b","c","d","e"])
26-
27-
# Default heatmap
28-
p1 = sns.heatmap(df)
19+
const quickCode = `# libraries
20+
import matplotlib.pyplot as plt
21+
import numpy as np
22+
import pandas as pd
23+
24+
# data
25+
df = pd.DataFrame({
26+
'x_axis': range(1,10),
27+
'y_axis': np.random.randn(9)*80+range(1,10)
28+
})
29+
30+
# plot
31+
plt.plot('x_axis', 'y_axis', data=df, linestyle='-', marker='o')
32+
plt.show()
2933
`
3034

3135
export default function ConnectedScatter() {
@@ -43,7 +47,12 @@ export default function ConnectedScatter() {
4347
<h2 id="Quick">&#9201; Quick start</h2>
4448
<Row className="align-items-center">
4549
<Col md={6}>
46-
<p>TODO.🔥</p>
50+
<p>Building a connected scatterplot with Python and Matplotlib is a breeze thanks to
51+
the <code>plot()</code> function. The 2 first argumenst are the X and Y values respectively, which
52+
can be stored in a <code>pandas</code> data frame.</p>
53+
<p>The <code>linestyle</code> and <code>marker</code> arguments allow to use line and circles to make it look like
54+
a connected scatterplot. It means everything is very close to a <Link to="/line-chart">line chart</Link> or a <Link to="/scatter-plot">scatterplot</Link> that
55+
are extensively described in the gallery.</p>
4756
</Col>
4857
<Col md={6}>
4958
<Link to={"/132-basic-connected-scatterplot"}>
@@ -82,13 +91,7 @@ export default function ConnectedScatter() {
8291
a line chart, so feel free to visit the related section. Here are a few examples to remind the
8392
basics and understand how to customize the markers.
8493
</p>
85-
<Row>
86-
<ChartImageContainer
87-
imgName="132_Matplotlib-connected-scatterplot"
88-
caption="Basic connected scatterplot with Python and Seaborn."
89-
linkTo="/132-basic-connected-scatterplot"
90-
/>
91-
</Row>
94+
<p><i>Coming soon</i></p>
9295
</Container>
9396

9497
<Spacing />

src/pages/line-chart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function LinePlot() {
4949
<Col md={6}>
5050
<Link to={"/120-line-chart-with-matplotlib"}>
5151
<ChartImage imgName="120_Basic_lineplot2"
52-
caption="The most basic histogram one can make with python and seaborn" />
52+
caption="A basic line chart made with python and seaborn" />
5353
</Link>
5454
</Col>
5555
</Row>

static/.DS_Store

0 Bytes
Binary file not shown.
Loading

0 commit comments

Comments
 (0)