add/ rearrange docstrings

This commit is contained in:
Simon Christ 2022-04-05 13:43:19 +02:00
parent cc1bd28ccd
commit 8a584ceab4
4 changed files with 36 additions and 11 deletions

View File

@ -79,6 +79,13 @@ const _savemap = Dict(
"txt" => txt,
)
for out in Symbol.(unique(values(_savemap)))
@eval @doc """
$($out)([plot,], filename)
Save plot as $($out)-file.
""" $out
end
const _extension_map = Dict("tikz" => "tex")
function addExtension(fn::AbstractString, ext::AbstractString)

View File

@ -247,6 +247,12 @@ function prepare_output(plt::Plot)
_update_plot_object(plt)
end
"""
backend_object(plot)
Returns the backend representation of a Plot object.
Returns `nothing` if the backend does not support this.
"""
function backend_object(plt::Plot)
prepare_output(plt)
plt.o

View File

@ -1625,7 +1625,6 @@ end
@nospecialize
"Adds ax+b... straight line over the current plot, without changing the axis limits"
abline!(plt::Plot, a, b; kw...) =
plot!(plt, [0, 1], [b, b + a]; seriestype = :straightline, kw...)
@ -1670,16 +1669,6 @@ end
end
end
"""
areaplot([x,] y)
areaplot!([x,] y)
Draw a stacked area plot of the matrix y.
# Examples
```julia-repl
julia> areaplot(1:3, [1 2 3; 7 8 9; 4 5 6], seriescolor = [:red :green :blue], fillalpha = [0.2 0.3 0.4])
```
"""
@userplot AreaPlot
@recipe function f(a::AreaPlot)

View File

@ -478,4 +478,27 @@ xgrid!(args...; kw...) = plot!(; xgrid = args, kw...)
yaxis!(args...; kw...) = plot!(; yaxis = args, kw...)
ygrid!(args...; kw...) = plot!(; ygrid = args, kw...)
@doc """
abline!([plot,] a, b; kwargs...)
Adds ax+b... straight line over the current plot, without changing the axis limits
""" abline!
@doc """
areaplot([x,] y)
areaplot!([x,] y)
Draw a stacked area plot of the matrix y.
# Examples
```julia-repl
julia> areaplot(1:3, [1 2 3; 7 8 9; 4 5 6], seriescolor = [:red :green :blue], fillalpha = [0.2 0.3 0.4])
```
""" areaplot
@doc """
lens!([plot,] x, y, inset = (sp_index, bbox(x1, x2, y1, y2)))
Magnify a region of a plot given by `x` and `y`.
`sp_index` is the index of the subplot and `x1`, `x2`, `y1` and `y2` should be between `0` and `1`.
""" lens!
@specialize