StatsPlots.jl icon indicating copy to clipboard operation
StatsPlots.jl copied to clipboard

More Options for cornerplot

Open mileslucas opened this issue 5 years ago • 1 comments

This is a feature request.

Request

cornerplot should have more user-facing control for the final output.

Description:

A common use for corner plots are the analysis of MCMC chains (e.g. MCMCChains.jl exports a corner plot method). I have found myself on multiple occasions constructing my own corner plots because there is not enough granularity in the current cornerplot function. Most of these options are inspired from the corner library.

I propose the following options be added as keyword arguments to the current cornerplot recipe:

  • fit_line::Bool=false to determine whether to plot the correlation line on each scatter plot
  • histograms::Bool=true determines whether to plot the histograms at all. This ought to be equivalent to hist_pct=0.0 but in the current state that breaks the plot.
  • hist_kde::Bool=false, if true, will use density to plot the histograms rather than histogram (N.B. an alternative would be hist_type=density or hist_type=histogram)
  • scatter::Bool=true, if true, will plot the scatter like normal.
  • contours::Union{Bool, AbstractVector{<:AbstractFloat}=false, if true, will add contours, if a vector of numbers, use these as the contour levels.
  • quantiles::AbstractVector{<:AbstractFloat}, if provided, will add vertical dashed lines in each histogram plot at the given quantiles

I would love to hear feedback on these keyword arg names and defaults here.

Triage

I am willing to work on this but may require some input from someone more familiar to the cornerplot recipe. If that person would serve as a reviewer/contact for the eventual PR I can put in the work myself.

mileslucas avatar Dec 17 '19 00:12 mileslucas

I just asked about this on Zulip and was directed to a very nice implementation here!

Recipes here: https://github.com/JuliaEarth/GeoStatsBase.jl/blob/a1a67e498477f80890556443232c3e08a415e083/src/plotrecipes/cornerplot.jl https://github.com/JuliaEarth/GeoStatsBase.jl/blob/a1a67e498477f80890556443232c3e08a415e083/src/plotrecipes/distplot1D.jl https://github.com/JuliaEarth/GeoStatsBase.jl/blob/a1a67e498477f80890556443232c3e08a415e083/src/plotrecipes/distplot2D.jl

icweaver avatar Jan 13 '21 15:01 icweaver