Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defines
RecipesBase.apply_recipe(plotattributes, args...; kwargs...)
```
returning a `Vector{RecipeData}` where `RecipeData` holds the `plotattributes` Dict and the arguments returned in [`@recipe`](@ref) or in [`@series`](@ref).
```
```julia
struct RecipeData
plotattributes::AbstractDict{Symbol,Any}
args::Tuple
Expand Down
10 changes: 5 additions & 5 deletions docs/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ We have already seen an example for a user recipe in the syntax section above.
User recipes can also be used to define a custom visualization without necessarily wishing to plot a custom type.
For this purpose we can create a type to dispatch on.
The [`@userplot`](@ref) macro is a convenient way to do this.
```
```julia
@userplot MyPlot
```
expands to
```
```julia
mutable struct MyPlot
args
end
Expand All @@ -119,7 +119,7 @@ myplot!(args...; kw...) = plot!(MyPlot(args); kw...)

To check `args` type, define a struct with type parameters.

```
```julia
@userplot struct MyPlot{T<:Tuple{AbstractVector}}
args::T
end
Expand Down Expand Up @@ -259,11 +259,11 @@ We can define a seriestype `:yscaleplot`, that automatically shows data with a l
end
```
We can call it with `plot(...; ..., seriestype = :yscaleplot)` or we can define a shorthand with the [`@shorthands`](@ref) macro.
```
```julia
@shorthands myseries
```
expands to
```
```julia
export myseries, myseries!
myseries(args...; kw...) = plot(args...; kw..., seriestype = :myseries)
myseries!(args...; kw...) = plot!(args...; kw..., seriestype = :myseries)
Expand Down
8 changes: 4 additions & 4 deletions src/RecipesBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ should replace the current arguments.

An example:

```
```julia
using RecipesBase

# Our custom type that we want to display
type T end
struct T end

@recipe function plot{N<:Integer}(t::T, n::N = 1; customcolor = :green)
markershape --> :auto, :require
Expand Down Expand Up @@ -301,7 +301,7 @@ end
"""
Meant to be used inside a recipe to add additional RecipeData objects to the list:

```
```julia
@recipe function f(::T)
# everything get this setting
linecolor --> :red
Expand Down Expand Up @@ -334,7 +334,7 @@ end

"""
You can easily define your own plotting recipes with convenience methods:
```
```julia
@userplot GroupHist

@recipe function f(gh::GroupHist)
Expand Down