using InMemoryDatasets, StatisticalGraphics
# generate random data
ds = Dataset(x=rand(100), y=rand(100))
x | y | |
---|---|---|
identity | identity | |
Float64? | Float64? | |
1 | 0.0293157 | 0.233036 |
2 | 0.687145 | 0.608442 |
3 | 0.573531 | 0.641173 |
4 | 0.937313 | 0.0458298 |
5 | 0.744896 | 0.733196 |
6 | 0.46521 | 0.185374 |
7 | 0.171645 | 0.38665 |
8 | 0.473305 | 0.966061 |
9 | 0.742845 | 0.971776 |
10 | 0.733701 | 0.519754 |
11 | 0.732351 | 0.0878136 |
12 | 0.566473 | 0.476379 |
13 | 0.463048 | 0.547873 |
14 | 0.945522 | 0.395692 |
15 | 0.256381 | 0.0392874 |
16 | 0.535698 | 0.895115 |
17 | 0.0341927 | 0.160878 |
18 | 0.596057 | 0.105032 |
19 | 0.482691 | 0.874865 |
20 | 0.340233 | 0.725673 |
21 | 0.53501 | 0.572536 |
22 | 0.792093 | 0.399439 |
23 | 0.310808 | 0.105584 |
24 | 0.75179 | 0.904972 |
⋮ | ⋮ | ⋮ |
Use the size
keyword argument to control the symbol's size
sgplot(ds, Scatter(x=:x, y=:y, size=200))
The outlinecolor
and color
arguments control the outline and fill color of symbol
sgplot(ds, Scatter(x=:x, y=:y, size=200, outlinecolor=:white,
color=:steelblue))
The gradient
function may be used for creating fancier colors
sgplot(ds, Scatter(x=:x, y=:y, size=200, outlinecolor=:white,
color=gradient()))
By default, circle
will be used to depict the symbol, however, user may pass the symbol
argument to change the default behaviour
sgplot(ds, Scatter(x=:x, y=:y, size=200, outlinecolor=:white,
color=:steelblue, symbol=:square))
Pass the clip=false
keyword argument to avoid clipping the points in the boundary of the graph. Note that the clip=false
can be pass as a global argument. In this case all plots will be drawn with clip=false
.
sgplot(ds, Scatter(x=:x, y=:y, size=200, outlinecolor=:steelblue,
color=:white, clip=false))
User can change the wall color of the graph by passing the global wallcolor
option.
sgplot(ds, Scatter(x=:x, y=:y, size=200, outlinecolor=:steelblue,
color=:white, clip=false), wallcolor=:lightgray)
The grid for each axis can be set within the corresponding axis. This option must be pass to the sgplot
function.
sgplot(ds, Scatter(x=:x, y=:y, size=200, outlinecolor=:steelblue,
color=:white, clip=false), wallcolor=:lightgray,
xaxis=Axis(grid=true, gridcolor=:white),
yaxis=Axis(grid=true, gridcolor=:white))
This notebook was generated using Literate.jl.