Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #38 from daschw/recipes
Browse files Browse the repository at this point in the history
allow type recipes for `Number`s in arrays and surfaces
  • Loading branch information
daschw authored Apr 6, 2020
2 parents 55d8881 + 480c031 commit e4ab938
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/type_recipe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ function _apply_type_recipe(plotattributes, v::AbstractArray, letter)
end

# special handling for Surface... need to properly unwrap and re-wrap
_apply_type_recipe(plotattributes, v::Surface{<:AMat{<:DataPoint}}) = v
_apply_type_recipe(
plotattributes,
v::Surface{<:AMat{<:Union{AbstractFloat, Integer, AbstractString, Missing}}},
) = v
function _apply_type_recipe(plotattributes, v::Surface)
ret = _apply_type_recipe(plotattributes, v.surf)
if typeof(ret) <: Formatted
Expand All @@ -59,7 +62,11 @@ function _apply_type_recipe(plotattributes, v::Surface)
end

# don't do anything for datapoints or nothing
_apply_type_recipe(plotattributes, v::AbstractArray{<:DataPoint}, letter) = v
_apply_type_recipe(
plotattributes,
v::AbstractArray{<:Union{AbstractFloat, Integer, AbstractString, Missing}},
letter,
) = v
_apply_type_recipe(plotattributes, v::Nothing, letter) = v

# axis args before type recipes should still be mapped to all axes
Expand Down

0 comments on commit e4ab938

Please sign in to comment.