Platform
Resources
Pricing
Sign in
Get started
Mohammad Alharbi
Workspace
Fork
Public
Data Visualization Fundamentals
By
Mohammad Alharbi
Edited
Mar 26, 2023
Fork of
Lesson 3: Comparisons
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
ruleY
(
[
1
/
26
]
,
{
stroke
:
"orange"
}
)
,
Plot
.
barY
(
alphabet
,
{
x
:
"letter"
,
y
:
"frequency"
,
sort
:
{
x
:
"y"
,
reverse
:
true
}
}
)
,
Plot
.
ruleY
(
[
0
]
)
]
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
y
:
{
grid
:
true
}
,
marks
:
[
Plot
.
barY
(
[
1
/
26
]
,
{
fill
:
"orange"
,
fillOpacity
:
0.4
}
)
,
// Plot.ruleY([1 / 26], {stroke: "orange"}),
Plot
.
barY
(
alphabet
,
{
x
:
"letter"
,
y
:
"frequency"
,
sort
:
{
x
:
"y"
,
reverse
:
true
}
}
)
,
Plot
.
ruleY
(
[
0
]
)
]
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
// Plot.ruleY([0]),
Plot
.
lineY
(
power_vs_temperature
,
Plot
.
windowY
(
{
x
:
"date"
,
y
:
"temperature"
,
k
:
k
,
reduce
:
"mean"
,
stroke
:
"city"
}
)
)
]
,
color
:
{
domain
:
[
"Seattle"
,
"Los Angeles"
]
,
legend
:
true
}
,
marginLeft
:
50
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
dot
(
power_vs_temperature
,
{
x
:
"temperature"
,
y
:
"power"
,
fill
:
"city"
}
)
]
,
color
:
{
domain
:
[
"Seattle"
,
"Los Angeles"
]
,
legend
:
true
}
,
marginLeft
:
50
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import
{
athletes
}
from
"@observablehq/plot"
Insert cell
Plot
.
plot
(
{
facet
:
{
data
:
athletes
,
y
:
"sex"
,
marginLeft
:
50
}
,
grid
:
true
,
marks
:
[
Plot
.
rectY
(
athletes
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
"weight"
,
fill
:
"sex"
}
)
)
,
Plot
.
ruleY
(
[
0
]
)
]
}
)
Insert cell
Insert cell
import
{
bls
}
from
"@observablehq/plot-line"
Insert cell
import
{
power_vs_temperature
}
from
"@observablehq/guide-electricity"
Insert cell
import
{
Plot
}
from
"@mkfreeman/plot-tooltip"
Insert cell
import
{
stateage
}
from
"@observablehq/plot-bar"
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
letter
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
metro
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
k
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML