Skip to content

Commit

Permalink
Extended help to show all attributes (#4343)
Browse files Browse the repository at this point in the history
* all attributes in docstring

* remove duplicated replace
  • Loading branch information
BeastyBlacksmith authored Sep 9, 2022
1 parent ebd60b6 commit 8ea45ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/consts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@ end

# add all non_underscored forms to the _keyAliases
add_non_underscore_aliases!(_keyAliases)

function _generate_doclist(attributes)
replace(join(sort(collect(attributes)), "\n- "), "_" => "\\_")
end
15 changes: 15 additions & 0 deletions src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ There are lots of ways to pass in data, and lots of keyword arguments... just tr
When you pass in matrices, it splits by columns. To see the list of available attributes, use the `plotattr(attr)`
function, where `attr` is the symbol `:Series`, `:Subplot`, `:Plot`, or `:Axis`. Pass any attribute to `plotattr`
as a String to look up its docstring, e.g., `plotattr("seriestype")`.
# Extended help
## Series attributes
- $(_generate_doclist(_all_series_args))
## Axis attributes
Prepend these with the axis letter (x, y or z)
- $(_generate_doclist(Plots._all_axis_args))
## Subplot attributes
- $(_generate_doclist(Plots._all_subplot_args))
## Plot attributes
- $(_generate_doclist(Plots._all_plot_args))
"""
function plot(args...; kw...)
@nospecialize
Expand Down

0 comments on commit 8ea45ff

Please sign in to comment.