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