Skip to content

Commit

Permalink
fix documentation for rankplot
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Portal committed Nov 20, 2023
1 parent 9bcc97c commit 32a735d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
7 changes: 1 addition & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ using Plots
DocMeta.setdocmeta!(MCMCTesting, :DocTestSetup, :(using MCMCTesting); recursive=true)

makedocs(;
modules=[
MCMCTesting,
isdefined(Base, :get_extension) ?
Base.get_extension(MCMCTesting, :MCMCTestingPlotsExt) :
RecipesBase.apply_recipe
],
modules=[MCMCTesting,],
repo="https://github.com/Red-Portal/MCMCTesting.jl/blob/{commit}{path}#{line}",
sitename="MCMCTesting.jl",
format=Documenter.HTML(;
Expand Down
4 changes: 2 additions & 2 deletions docs/src/ranksim.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ simulate_ranks
## Visualizing Ranks with `Plots`
We provide a `Plots` recipe for visualizing the ranks:

```docs
```@docs
rankplot
```

Expand All @@ -22,7 +22,7 @@ This can be used as follows:
using Plots
using MCMCTesting

# Set up the simulation
# Set the simulation here

ranks = simulate_ranks(test, subject)
rankplot(test, ranks; param_names)
Expand Down
2 changes: 1 addition & 1 deletion src/MCMCTesting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export
mcmctest,
seqmcmctest,
simulate_ranks,
RankPlot
rankplot

using HypothesisTests
using MultipleTesting
Expand Down
10 changes: 6 additions & 4 deletions src/rankplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
Plot the simulated ranks using `simulate_ranks`.
!!! info
`Plots` must be imported *before* `MCMCTesting` to use this plot recipe.
`Plots` must be imported to use this plot recipe.
# Arguments
- test::ExactRankTest: The exact rank test object used to simulate the ranks.
- ranks: The output of `simulate_rank`.
- `test::ExactRankTest`: The exact rank test object used to simulate the ranks.
- `ranks`: The output of `simulate_rank`.
# Keyword Arguments
- stats_names: The name for the statistics used in the rank simulation. The default argument automatically assign default names. (Default: :auto).
- `stats_names`: The name for the statistics used in the rank simulation. The default argument automatically assign default names. (Default: :auto).
- Keyword arguments corresponding `Plots` attributes, such as `bins`, `layout`, `size`, may apply.
"""
function rankplot end

@userplot RankPlot
@recipe function f(h::RankPlot; stat_names = :auto)
if length(h.args) != 2 || !(typeof(h.args[1]) <: ExactRankTest)
Expand Down

0 comments on commit 32a735d

Please sign in to comment.