Merge remote-tracking branch 'upstream/master'
t push
This commit is contained in:
commit
25b09a7962
@ -466,7 +466,7 @@ autopick_ignore_none_auto(notarr, idx::Integer) = notarr
|
|||||||
function aliasesAndAutopick(plotattributes::KW, sym::Symbol, aliases::Dict{Symbol,Symbol}, options::AVec, plotIndex::Int)
|
function aliasesAndAutopick(plotattributes::KW, sym::Symbol, aliases::Dict{Symbol,Symbol}, options::AVec, plotIndex::Int)
|
||||||
if plotattributes[sym] == :auto
|
if plotattributes[sym] == :auto
|
||||||
plotattributes[sym] = autopick_ignore_none_auto(options, plotIndex)
|
plotattributes[sym] = autopick_ignore_none_auto(options, plotIndex)
|
||||||
elseif haskey(aliases, [sym])
|
elseif haskey(aliases, plotattributes[sym])
|
||||||
plotattributes[sym] = aliases[plotattributes[sym]]
|
plotattributes[sym] = aliases[plotattributes[sym]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1144,11 +1144,11 @@ function _display(plt::Plot{GLVisualizeBackend}, visible = true)
|
|||||||
vis = gl_boxplot(plotattributes, kw_args)
|
vis = gl_boxplot(plotattributes, kw_args)
|
||||||
elseif st == :volume
|
elseif st == :volume
|
||||||
volume = plotattributes[:y]
|
volume = plotattributes[:y]
|
||||||
_d = copy(plotattributes)
|
_plotattributes = copy(plotattributes)
|
||||||
_d[:y] = 0:1
|
_plotattributes[:y] = 0:1
|
||||||
_d[:x] = 0:1
|
_plotattributes[:x] = 0:1
|
||||||
kw_args = KW()
|
kw_args = KW()
|
||||||
extract_gradient(_d, kw_args, :fill)
|
extract_gradient(_plotattributes, kw_args, :fill)
|
||||||
vis = visualize(volume.v, Style(:default), kw_args)
|
vis = visualize(volume.v, Style(:default), kw_args)
|
||||||
else
|
else
|
||||||
error("failed to display plot type $st")
|
error("failed to display plot type $st")
|
||||||
|
|||||||
@ -573,7 +573,7 @@ function plotly_series(plt::Plot, series::Series)
|
|||||||
|
|
||||||
# set the "type"
|
# set the "type"
|
||||||
if st in (:path, :scatter, :scattergl, :straightline, :path3d, :scatter3d)
|
if st in (:path, :scatter, :scattergl, :straightline, :path3d, :scatter3d)
|
||||||
return plotly_series_segments(series, plotattributes, x, y, z, clims)
|
return plotly_series_segments(series, plotattributes_out, x, y, z, clims)
|
||||||
|
|
||||||
elseif st == :heatmap
|
elseif st == :heatmap
|
||||||
x = heatmap_edges(x, sp[:xaxis][:scale])
|
x = heatmap_edges(x, sp[:xaxis][:scale])
|
||||||
@ -678,7 +678,7 @@ function plotly_series_shapes(plt::Plot, series::Series, clims)
|
|||||||
:fillcolor => rgba_string(plot_color(get_fillcolor(series, clims, i), get_fillalpha(series, i))),
|
:fillcolor => rgba_string(plot_color(get_fillcolor(series, clims, i), get_fillalpha(series, i))),
|
||||||
))
|
))
|
||||||
if series[:markerstrokewidth] > 0
|
if series[:markerstrokewidth] > 0
|
||||||
plotattributes[:line] = KW(
|
plotattributes_out[:line] = KW(
|
||||||
:color => rgba_string(plot_color(get_linecolor(series, clims, i), get_linealpha(series, i))),
|
:color => rgba_string(plot_color(get_linecolor(series, clims, i), get_linealpha(series, i))),
|
||||||
:width => get_linewidth(series, i),
|
:width => get_linewidth(series, i),
|
||||||
:dash => string(get_linestyle(series, i)),
|
:dash => string(get_linestyle(series, i)),
|
||||||
@ -699,7 +699,7 @@ function plotly_series_shapes(plt::Plot, series::Series, clims)
|
|||||||
plotattributes_outs
|
plotattributes_outs
|
||||||
end
|
end
|
||||||
|
|
||||||
function plotly_series_segments(series::Series, ploattributes_base::KW, x, y, z, clims)
|
function plotly_series_segments(series::Series, plotattributes_base::KW, x, y, z, clims)
|
||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
sp = series[:subplot]
|
sp = series[:subplot]
|
||||||
isscatter = st in (:scatter, :scatter3d, :scattergl)
|
isscatter = st in (:scatter, :scatter3d, :scattergl)
|
||||||
@ -727,11 +727,11 @@ function plotly_series_segments(series::Series, ploattributes_base::KW, x, y, z,
|
|||||||
hasline ? "lines" : "none"
|
hasline ? "lines" : "none"
|
||||||
end
|
end
|
||||||
if series[:fillrange] == true || series[:fillrange] == 0 || isa(series[:fillrange], Tuple)
|
if series[:fillrange] == true || series[:fillrange] == 0 || isa(series[:fillrange], Tuple)
|
||||||
plotattributes[:fill] = "tozeroy"
|
plotattributes_out[:fill] = "tozeroy"
|
||||||
plotattributes[:fillcolor] = rgba_string(plot_color(get_fillcolor(series, clims, i), get_fillalpha(series, i)))
|
plotattributes_out[:fillcolor] = rgba_string(plot_color(get_fillcolor(series, clims, i), get_fillalpha(series, i)))
|
||||||
elseif typeof(series[:fillrange]) <: Union{AbstractVector{<:Real}, Real}
|
elseif typeof(series[:fillrange]) <: Union{AbstractVector{<:Real}, Real}
|
||||||
plotattributes[:fill] = "tonexty"
|
plotattributes_out[:fill] = "tonexty"
|
||||||
plotattributes[:fillcolor] = rgba_string(plot_color(get_fillcolor(series, clims, i), get_fillalpha(series, i)))
|
plotattributes_out[:fillcolor] = rgba_string(plot_color(get_fillcolor(series, clims, i), get_fillalpha(series, i)))
|
||||||
elseif !(series[:fillrange] in (false, nothing))
|
elseif !(series[:fillrange] in (false, nothing))
|
||||||
@warn("fillrange ignored... plotly only supports filling to zero and to a vector of values. fillrange: $(series[:fillrange])")
|
@warn("fillrange ignored... plotly only supports filling to zero and to a vector of values. fillrange: $(series[:fillrange])")
|
||||||
end
|
end
|
||||||
@ -763,7 +763,7 @@ function plotly_series_segments(series::Series, ploattributes_base::KW, x, y, z,
|
|||||||
|
|
||||||
# add "line"
|
# add "line"
|
||||||
if hasline
|
if hasline
|
||||||
plotattributes[:line] = KW(
|
plotattributes_out[:line] = KW(
|
||||||
:color => rgba_string(plot_color(get_linecolor(series, clims, i), get_linealpha(series, i))),
|
:color => rgba_string(plot_color(get_linecolor(series, clims, i), get_linealpha(series, i))),
|
||||||
:width => get_linewidth(series, i),
|
:width => get_linewidth(series, i),
|
||||||
:shape => if st == :steppre
|
:shape => if st == :steppre
|
||||||
|
|||||||
@ -1024,10 +1024,6 @@ end
|
|||||||
@assert length(g.args) == 1 && typeof(g.args[1]) <: AbstractMatrix
|
@assert length(g.args) == 1 && typeof(g.args[1]) <: AbstractMatrix
|
||||||
seriestype := :spy
|
seriestype := :spy
|
||||||
mat = g.args[1]
|
mat = g.args[1]
|
||||||
if length(unique(mat[mat .!= 0])) < 2
|
|
||||||
legend --> nothing
|
|
||||||
seriescolor --> cgrad([invisible(), fg_color(plotattributes)])
|
|
||||||
end
|
|
||||||
n,m = size(mat)
|
n,m = size(mat)
|
||||||
Plots.SliceIt, 1:m, 1:n, Surface(mat)
|
Plots.SliceIt, 1:m, 1:n, Surface(mat)
|
||||||
end
|
end
|
||||||
@ -1035,21 +1031,23 @@ end
|
|||||||
@recipe function f(::Type{Val{:spy}}, x,y,z)
|
@recipe function f(::Type{Val{:spy}}, x,y,z)
|
||||||
yflip := true
|
yflip := true
|
||||||
aspect_ratio := 1
|
aspect_ratio := 1
|
||||||
|
|
||||||
rs, cs, zs = findnz(z.surf)
|
rs, cs, zs = findnz(z.surf)
|
||||||
newz = fill(NaN, size(z)...)
|
xlim := ignorenan_extrema(cs)
|
||||||
|
ylim := ignorenan_extrema(rs)
|
||||||
for i in eachindex(zs)
|
if plotattributes[:markershape] == :none
|
||||||
newz[rs[i],cs[i]] = zs[i]
|
markershape := :circle
|
||||||
end
|
end
|
||||||
|
if plotattributes[:markersize] == default(:markersize)
|
||||||
seriestype := :heatmap
|
markersize := 1
|
||||||
|
end
|
||||||
|
markerstrokewidth := 0
|
||||||
|
marker_z := zs
|
||||||
|
label := ""
|
||||||
|
x := cs
|
||||||
|
y := rs
|
||||||
|
z := nothing
|
||||||
|
seriestype := :scatter
|
||||||
grid --> false
|
grid --> false
|
||||||
framestyle --> :box
|
|
||||||
|
|
||||||
x := x
|
|
||||||
y := y
|
|
||||||
z := Surface(newz)
|
|
||||||
()
|
()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user