-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from davidanthoff/doc3
Doc3
- Loading branch information
Showing
18 changed files
with
11,375 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Area Charts & Streamgraphs | ||
|
||
## Area Chart | ||
|
||
```@example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Bar Charts & Histograms | ||
|
||
## Simple Bar Chart | ||
|
||
```@example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Box Plots | ||
|
||
## Box Plot with Min/Max Whiskers | ||
|
||
```@example | ||
using VegaLite, VegaDatasets | ||
dataset("population") |> | ||
@vlplot( | ||
transform=[{ | ||
aggregate=[ | ||
{op=:q1, field=:people, as=:lowerBox}, | ||
{op=:q3, field=:people, as=:upperBox}, | ||
{op=:median, field=:people, as=:midBox}, | ||
{op=:min, field=:people, as=:lowerWhisker}, | ||
{op=:max, field=:people, as=:upperWhisker} | ||
], | ||
groupby=[:age] | ||
}] | ||
) + | ||
@vlplot( | ||
mark={:rule, style=:boxWhisker}, | ||
y={"lowerWhisker:q", axis={title="population"}}, | ||
y2="lowerBox:q", | ||
x="age:o" | ||
) + | ||
@vlplot( | ||
mark={:rule, style=:boxWhisker}, | ||
y="upperBox:q", | ||
y2="upperWhisker:q", | ||
x="age:o" | ||
) + | ||
@vlplot( | ||
mark={:bar, style=:box}, | ||
y="lowerBox:q", | ||
y2="upperBox:q", | ||
x="age:o", | ||
size={value=5} | ||
) + | ||
@vlplot( | ||
mark={:tick, style=:boxMid}, | ||
y="midBox:q", | ||
x="age:o", | ||
color={value=:white}, | ||
size={value=5} | ||
) | ||
``` | ||
|
||
## Tukey Box Plot (1.5 IQR) | ||
|
||
```@example | ||
using VegaLite, VegaDatasets | ||
dataset("population") |> | ||
@vlplot( | ||
transform=[ | ||
{ | ||
aggregate=[ | ||
{op=:q1, field=:people, as=:lowerBox}, | ||
{op=:q3, field=:people, as=:upperBox}, | ||
{op=:median, field=:people, as=:midBox} | ||
], | ||
groupby=[:age] | ||
}, | ||
{ | ||
calculate="datum.upperBox - datum.lowerBox", | ||
as=:IQR | ||
}, | ||
{ | ||
calculate="datum.lowerBox - datum.IQR * 1.5", | ||
as=:lowerWhisker | ||
}, | ||
{ | ||
calculate="datum.upperBox + datum.IQR * 1.5", | ||
as=:upperWhisker | ||
} | ||
] | ||
) + | ||
@vlplot( | ||
mark={:rule, style=:boxWhisker}, | ||
y={"lowerWhisker:q", axis={title="population"}}, | ||
y2="lowerBox:q", | ||
x="age:o" | ||
) + | ||
@vlplot( | ||
mark={:rule, style=:boxWhisker}, | ||
y="upperBox:q", | ||
y2="upperWhisker:q", | ||
x="age:o" | ||
) + | ||
@vlplot( | ||
mark={:bar, style=:box}, | ||
y="lowerBox:q", | ||
y2="upperBox:q", | ||
x="age:o", | ||
size={value=5} | ||
) + | ||
@vlplot( | ||
mark={:tick, style=:boxMid}, | ||
y="midBox:q", | ||
x="age:o", | ||
color={value=:white}, | ||
size={value=5} | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# Error Bars & Error Bands | ||
|
||
## Error Bars showing Confidence Interval | ||
|
||
```@example | ||
using VegaLite, VegaDatasets | ||
dataset("barley") |> | ||
@vlplot() + | ||
@vlplot( | ||
mark={ | ||
:point, | ||
filled=true | ||
}, | ||
x={ | ||
"mean(yield)", | ||
scale={zero=false}, | ||
axis={title="Barley Yield"} | ||
}, | ||
y={ | ||
"variety:o", | ||
color={value=:black} | ||
} | ||
) + | ||
@vlplot(:rule, x="ci0(yield)", x2="ci1(yield)", y="variety:o") | ||
``` | ||
|
||
## Error Bars showing Standard Deviation | ||
|
||
```@example | ||
using VegaLite, VegaDatasets | ||
dataset("barley") |> | ||
@vlplot( | ||
transform=[ | ||
{ | ||
aggregate=[ | ||
{op=:mean, field=:yield, as=:mean}, | ||
{op=:stdev, field=:yield, as=:stdev} | ||
], | ||
groupby=[:variety] | ||
}, | ||
{calculate="datum.mean-datum.stdev", as=:lower}, | ||
{calculate="datum.mean+datum.stdev", as=:upper} | ||
] | ||
) + | ||
@vlplot( | ||
mark={ | ||
:point, | ||
filled=true | ||
}, | ||
x={ | ||
"mean:q", | ||
scale={zero=false}, | ||
axis={title="Barley Yield"} | ||
}, | ||
y="variety:o", | ||
color={value=:black} | ||
) + | ||
@vlplot(:rule, x="upper:q", x2="lower:q", y="variety:o") | ||
``` | ||
|
||
## Line Chart with Confidence Interval Band | ||
|
||
```@example | ||
using VegaLite, VegaDatasets | ||
dataset("cars") |> | ||
@vlplot() + | ||
@vlplot( | ||
:area, | ||
x="year(Year):t", | ||
y={ | ||
"ci0(Miles_per_Gallon)", | ||
axis={title="Mean of Miles per Gallon (95% CIs)"} | ||
}, | ||
y2="ci1(Miles_per_Gallon)", | ||
opacity={value=0.3} | ||
) + | ||
@vlplot( | ||
:line, | ||
x="year(Year)", | ||
y="mean(Miles_per_Gallon)" | ||
) | ||
``` | ||
|
||
## Scatterplot with Mean and Standard Deviation Overlay | ||
|
||
```@example | ||
using VegaLite, VegaDatasets | ||
dataset("cars") |> | ||
@vlplot() + | ||
@vlplot( | ||
:point, | ||
x=:Horsepower, | ||
y=:Miles_per_Gallon | ||
) + | ||
( | ||
@vlplot( | ||
transform=[ | ||
{aggregate=[ | ||
{op=:mean, field=:Miles_per_Gallon, as=:mean_MPG}, | ||
{op=:stdev, field=:Miles_per_Gallon, as=:dev_MPG} | ||
], | ||
groupby=[] | ||
}, | ||
{calculate="datum.mean_MPG - datum.dev_MPG", as=:lower}, | ||
{calculate="datum.mean_MPG + datum.dev_MPG", as=:upper} | ||
]) + | ||
@vlplot(:rule,y={"mean_MPG:q",axis=nothing}) + | ||
@vlplot( | ||
:rect, | ||
y={"lower:q",axis=nothing}, | ||
y2="upper:q", | ||
opacity={value=0.2} | ||
) | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Repeat & Concatenation | ||
|
||
## Repeat and layer to show different weather measures | ||
|
||
```@example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Scatter & Strip Plots | ||
|
||
## Scatterplot | ||
|
||
```@example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Simple Charts | ||
|
||
## Simple Bar Chart | ||
|
||
```@example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Table-based Plots | ||
|
||
## Table Heatmap | ||
|
||
```@example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,29 @@ | ||
# VegaLite.jl | ||
|
||
[VegaLite.jl](https://github.com/fredo-dedup/VegaLite.jl) enables the generation of [Vega-Lite](https://vega.github.io/vega-lite/) plots from Julia. | ||
## Overview | ||
|
||
[Vega-Lite](https://vega.github.io/vega-lite/) is a visualization grammar describing mappings from data to graphical properties (e.g. marks, axes, scales). For rendering it uses pre-defined design rules that keep the visualization specification succinct while still leaving user control. | ||
[VegaLite.jl](https://github.com/fredo-dedup/VegaLite.jl) is a plotting package for the [julia](https://julialang.org/) programming language. The package is based on [Vega-Lite](https://vega.github.io/vega-lite/), which extends a traditional [grammar of graphics](https://doi.org/10.1007/0-387-28695-0) API into a [grammar of interactive graphics](https://doi.org/10.1109/TVCG.2016.2599030). | ||
|
||
Vega-Lite supports: | ||
- data transformation, sorting, filtering and grouping. | ||
- aggregation, binning, and simple statistical analysis (e.g. mean, std, var, count). | ||
- plots can be faceted, layered and stacked vertically or horizontally. | ||
|
||
### Installation | ||
|
||
To install the package run `Pkg.add("VegaLite")`. | ||
|
||
### Principles | ||
|
||
The package is essentially a thin layer translating Julia statements to the [Vega-Lite](https://vega.github.io/vega-lite/) visualization specification format. | ||
|
||
One can take any Vega-Lite specification and easily translate it into corresponding julia code. In addition, the package provides various ways to specify figures in a much more concise way. Here is an example of a scatter plot with a legend: | ||
[VegaLite.jl](https://github.com/fredo-dedup/VegaLite.jl) allows you to create a wide range of statistical plots. It exposes the full functionality of the underlying [Vega-Lite](https://vega.github.io/vega-lite/) and is a the same time tightly integrated into the julia ecosystem. Here is an example of a scatter plot: | ||
|
||
```@example | ||
using VegaLite, VegaDatasets | ||
dataset("cars") |> | ||
@vlplot( | ||
:point, | ||
x=:Horsepower, | ||
y=:Miles_per_Gallon, | ||
color=:Origin, | ||
width=400, | ||
height=400 | ||
:point, | ||
x=:Horsepower, | ||
y=:Miles_per_Gallon, | ||
color=:Origin, | ||
width=400, | ||
height=400 | ||
) | ||
``` | ||
|
||
## Installation | ||
|
||
To install [VegaLite.jl](https://github.com/fredo-dedup/VegaLite.jl), run the following julia code: | ||
|
||
```julia | ||
Pkg.add("VegaLite") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
!!! note | ||
|
||
This section is outdated and does not reflect the latest API of the package. | ||
|
||
## Functions | ||
|
||
|
||
|
Oops, something went wrong.