Changed grid to Axis attribute

This commit is contained in:
sfoo 2017-02-21 06:41:03 -08:00
parent 44f4f22fdd
commit ea0100fa5b
3 changed files with 9 additions and 2 deletions

View File

@ -50,6 +50,8 @@ export
yflip!,
xaxis!,
yaxis!,
xgrid!,
ygrid!,
xlims,
ylims,
@ -195,6 +197,8 @@ xflip!(flip::Bool = true; kw...) = plot!(; xflip = flip
yflip!(flip::Bool = true; kw...) = plot!(; yflip = flip, kw...)
xaxis!(args...; kw...) = plot!(; xaxis = args, kw...)
yaxis!(args...; kw...) = plot!(; yaxis = args, kw...)
xgrid!(grid::Bool = true; kw...) = plot!(; xgrid = grid, kw...)
ygrid!(grid::Bool = true; kw...) = plot!(; ygrid = grid, kw...)
let PlotOrSubplot = Union{Plot, Subplot}
title!(plt::PlotOrSubplot, s::AbstractString; kw...) = plot!(plt; title = s, kw...)
@ -218,6 +222,8 @@ let PlotOrSubplot = Union{Plot, Subplot}
yflip!(plt::PlotOrSubplot, flip::Bool = true; kw...) = plot!(plt; yflip = flip, kw...)
xaxis!(plt::PlotOrSubplot, args...; kw...) = plot!(plt; xaxis = args, kw...)
yaxis!(plt::PlotOrSubplot, args...; kw...) = plot!(plt; yaxis = args, kw...)
xgrid!(plt::PlotOrSubplot, grid::Bool = true; kw...) = plot!(plt; xgrid = grid, kw...)
ygrid!(plt::PlotOrSubplot, grid::Bool = true; kw...) = plot!(plt; ygrid = grid, kw...)
end

View File

@ -83,7 +83,6 @@ const _arg_desc = KW(
:colorbar => "Bool (show the colorbar?) or Symbol (colorbar position). Symbol values: `:none`, `:best`, `:right`, `:left`, `:top`, `:bottom`, `:legend` (matches legend value) (note: only some may be supported in each backend)",
:clims => "`:auto` or NTuple{2,Number}. Fixes the limits of the colorbar.",
:legendfont => "Font. Font of legend items.",
:grid => "Bool. Show the grid lines?",
:annotations => "(x,y,text) tuple(s). Can be a single tuple or a list of them. Text can be String or PlotText (created with `text(args...)`) Add one-off text annotations at the x,y coordinates.",
:projection => "Symbol or String. '3d' or 'polar'",
:aspect_ratio => "Symbol (:equal) or Number. Plot area is resized so that 1 y-unit is the same size as `apect_ratio` x-units.",
@ -110,5 +109,6 @@ const _arg_desc = KW(
:foreground_color_text => "Color Type or `:match` (matches `:foreground_color_subplot`). Color of tick labels.",
:foreground_color_guide => "Color Type or `:match` (matches `:foreground_color_subplot`). Color of axis guides (axis labels).",
:mirror => "Bool. Switch the side of the tick labels (right or top).",
:grid => "Bool. Show grid lines?"
)

View File

@ -249,7 +249,6 @@ const _subplot_defaults = KW(
:colorbar => :legend,
:clims => :auto,
:legendfont => font(8),
:grid => true,
:annotations => [], # annotation tuples... list of (x,y,annotation)
:projection => :none, # can also be :polar or :3d
:aspect_ratio => :none, # choose from :none or :equal
@ -279,6 +278,7 @@ const _axis_defaults = KW(
:discrete_values => [],
:formatter => :auto,
:mirror => false,
:grid => true,
)
const _suppress_warnings = Set{Symbol}([
@ -315,6 +315,7 @@ for letter in (:x,:y,:z)
# :foreground_color_guide,
# :discrete_values,
# :formatter,
# :grid,
# )
_axis_defaults_byletter[Symbol(letter,k)] = :match