This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor dodge and improve boxplot, violin and crossbar (#712)
* dodge violin * simplify barplot code * add dodge support to boxplot and crossbar * docs * remove dodge_gap for violin * revert removing dodge_gap * boxplot cleanup * clean up boxplot * fix docs * outlier color matches color by default * code uniformity * uniform density and violin
- Loading branch information
Pietro Vertechi
authored
Apr 28, 2021
1 parent
8d56022
commit ef3af81
Showing
8 changed files
with
178 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# boxplot | ||
|
||
```@docs | ||
boxplot | ||
``` | ||
|
||
### Examples | ||
|
||
```@example | ||
using CairoMakie | ||
CairoMakie.activate!() # hide | ||
AbstractPlotting.inline!(true) # hide | ||
xs = rand(["a", "b", "c"], 1000) | ||
ys = randn(1000) | ||
boxplot(xs, ys) | ||
``` | ||
|
||
```@example | ||
using CairoMakie | ||
CairoMakie.activate!() # hide | ||
AbstractPlotting.inline!(true) # hide | ||
xs = rand(["a", "b", "c"], 1000) | ||
ys = randn(1000) | ||
dodge = rand(1:2, 1000) | ||
boxplot(xs, ys, dodge = dodge, show_notch = true) | ||
``` |
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,21 @@ | ||
# crossbar | ||
|
||
```@docs | ||
crossbar | ||
``` | ||
|
||
### Examples | ||
|
||
```@example | ||
using CairoMakie | ||
CairoMakie.activate!() # hide | ||
AbstractPlotting.inline!(true) # hide | ||
xs = [1, 1, 2, 2, 3, 3] | ||
ys = rand(6) | ||
ymins = ys .- 1 | ||
ymaxs = ys .+ 1 | ||
dodge = [1, 2, 1, 2, 1, 2] | ||
crossbar(xs, ys, ymins, ymaxs, dodge = dodge, show_notch = true) | ||
``` |
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,38 @@ | ||
# violin | ||
|
||
```@docs | ||
violin | ||
``` | ||
|
||
### Examples | ||
|
||
```@example | ||
using CairoMakie | ||
CairoMakie.activate!() # hide | ||
AbstractPlotting.inline!(true) # hide | ||
xs = rand(["a", "b", "c"], 1000) | ||
ys = randn(1000) | ||
violin(xs, ys) | ||
``` | ||
|
||
```@example | ||
using CairoMakie | ||
CairoMakie.activate!() # hide | ||
AbstractPlotting.inline!(true) # hide | ||
xs1 = rand(["a", "b", "c"], 1000) | ||
ys1 = randn(1000) | ||
dodge1 = rand(1:2, 1000) | ||
xs2 = rand(["a", "b", "c"], 1000) | ||
ys2 = randn(1000) | ||
dodge2 = rand(1:2, 1000) | ||
fig = Figure() | ||
ax = Axis(fig[1, 1]) | ||
violin!(ax, xs1, ys1, dodge = dodge1, side = :left, color = "orange") | ||
violin!(ax, xs2, ys2, dodge = dodge2, side = :right, color = "teal") | ||
fig | ||
``` |
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
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
Oops, something went wrong.