update grid defaults and modify grid example
This commit is contained in:
parent
682ba1f764
commit
4b60b05f75
@ -175,7 +175,7 @@ function hasgrid(arg::Symbol, letter)
|
|||||||
if arg in _allGridSyms
|
if arg in _allGridSyms
|
||||||
arg in (:all, :both, :on) || contains(string(arg), string(letter))
|
arg in (:all, :both, :on) || contains(string(arg), string(letter))
|
||||||
else
|
else
|
||||||
warn("Unknown grid argument $arg; $letter\grid was set to `true` instead")
|
warn("Unknown grid argument $arg; $letter\grid was set to `true` instead.")
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -303,9 +303,9 @@ const _axis_defaults = KW(
|
|||||||
:mirror => false,
|
:mirror => false,
|
||||||
:grid => true,
|
:grid => true,
|
||||||
:foreground_color_grid => :match, # grid color
|
:foreground_color_grid => :match, # grid color
|
||||||
:gridalpha => 0.3,
|
:gridalpha => 0.1,
|
||||||
:gridstyle => :dot,
|
:gridstyle => :solid,
|
||||||
:gridlinewidth => 1,
|
:gridlinewidth => 0.5,
|
||||||
)
|
)
|
||||||
|
|
||||||
const _suppress_warnings = Set{Symbol}([
|
const _suppress_warnings = Set{Symbol}([
|
||||||
|
|||||||
@ -321,7 +321,7 @@ PlotExample("Animation with subplots",
|
|||||||
),
|
),
|
||||||
|
|
||||||
PlotExample("Spy",
|
PlotExample("Spy",
|
||||||
"For a matrix `mat` with unique nonzeros `spy(mat)` returns a colorless plot. If `mat` has various different nonzero values, a colorbar is added. The colorbar can be disabled with `legend = nothing`. As always, the marker shape and size can be changed with `spy(mat, markersize = 3, markershape = :star)`",
|
"For a matrix `mat` with unique nonzeros `spy(mat)` returns a colorless plot. If `mat` has various different nonzero values, a colorbar is added. The colorbar can be disabled with `legend = nothing`. As always, the marker shape and size can be changed with `spy(mat, markersize = 3, markershape = :star)`.",
|
||||||
[:(begin
|
[:(begin
|
||||||
a = spdiagm((ones(50), ones(49), ones(49), ones(40), ones(40)),(0, 1, -1, 10, -10))
|
a = spdiagm((ones(50), ones(49), ones(49), ones(40), ones(40)),(0, 1, -1, 10, -10))
|
||||||
b = spdiagm((1:50, 1:49, 1:49, 1:40, 1:40),(0, 1, -1, 10, -10))
|
b = spdiagm((1:50, 1:49, 1:49, 1:40, 1:40),(0, 1, -1, 10, -10))
|
||||||
@ -330,13 +330,13 @@ PlotExample("Spy",
|
|||||||
),
|
),
|
||||||
|
|
||||||
PlotExample("Magic grid argument",
|
PlotExample("Magic grid argument",
|
||||||
"The grid lines can be modified individually for each axis with the magic grid argument",
|
"The grid lines can be modified individually for each axis with the magic grid argument.",
|
||||||
[:(begin
|
[:(begin
|
||||||
x = rand(10)
|
x = rand(10)
|
||||||
p1 = plot(x, title = "Default looks")
|
p1 = plot(x, title = "Default looks")
|
||||||
p2 = plot(x, grid = (:y, :olivedrab, :solid, 0.5), title = "Modified y grid")
|
p2 = plot(x, grid = (:y, :olivedrab, :dot, 1, 0.9), title = "Modified y grid")
|
||||||
p3 = plot(deepcopy(p2), title = "Add x grid")
|
p3 = plot(deepcopy(p2), title = "Add x grid")
|
||||||
xgrid!(p3, :on, :cadetblue, 2, :dashdot)
|
xgrid!(p3, :on, :cadetblue, 2, :dashdot, 0.4)
|
||||||
plot(p1, p2, p3, layout = (1, 3), label = "", fillrange = 0, fillalpha = 0.3)
|
plot(p1, p2, p3, layout = (1, 3), label = "", fillrange = 0, fillalpha = 0.3)
|
||||||
end)]
|
end)]
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user