UnicodePlots: add more extra_kwargs (#4097)
This commit is contained in:
parent
59cd5c180e
commit
5d8acf5189
@ -73,6 +73,8 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
|
|||||||
blend &= !(quiver || contour)
|
blend &= !(quiver || contour)
|
||||||
|
|
||||||
plot_3d && (xlim = ylim = (0, 0)) # determined using projection
|
plot_3d && (xlim = ylim = (0, 0)) # determined using projection
|
||||||
|
azimuth, elevation = sp[:camera] # PyPlot: azimuth = -60 & elevation = 30
|
||||||
|
projection = plot_3d ? get(sp[:extra_kwargs], :projection, :orthographic) : nothing
|
||||||
|
|
||||||
kw = (
|
kw = (
|
||||||
compact = true,
|
compact = true,
|
||||||
@ -89,11 +91,10 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
|
|||||||
xlim = xlim,
|
xlim = xlim,
|
||||||
ylim = ylim,
|
ylim = ylim,
|
||||||
# 3d
|
# 3d
|
||||||
projection = plot_3d ? :orthographic : nothing,
|
projection = projection,
|
||||||
up = sp[:zaxis][:flip] ? :mz : :pz,
|
elevation = elevation,
|
||||||
# PyPlot: azimuth = -60 & elevation = 30
|
azimuth = azimuth,
|
||||||
azimuth = -45,
|
up = get(sp[:extra_kwargs], :up, :z),
|
||||||
elevation = 30,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
o = UnicodePlots.Plot(x, y, plot_3d ? z : nothing, _canvas_map[canvas]; kw...)
|
o = UnicodePlots.Plot(x, y, plot_3d ? z : nothing, _canvas_map[canvas]; kw...)
|
||||||
@ -184,13 +185,16 @@ function addUnicodeSeries!(
|
|||||||
end
|
end
|
||||||
elseif st in (:surface, :wireframe) # 3D
|
elseif st in (:surface, :wireframe) # 3D
|
||||||
colormap = get(series[:extra_kwargs], :colormap, :none)
|
colormap = get(series[:extra_kwargs], :colormap, :none)
|
||||||
|
lines = get(series[:extra_kwargs], :lines, st === :wireframe)
|
||||||
|
zscale = get(series[:extra_kwargs], :zscale, :identity)
|
||||||
kw = (
|
kw = (
|
||||||
kw...,
|
kw...,
|
||||||
zlabel = sp[:colorbar_title],
|
zlabel = sp[:colorbar_title],
|
||||||
colormap = colormap === :none ? up_cmap(series) : colormap,
|
colormap = colormap === :none ? up_cmap(series) : colormap,
|
||||||
colorbar = hascolorbar(sp),
|
colorbar = hascolorbar(sp),
|
||||||
color = st === :wireframe ? up_color(get_linecolor(series, 1)) : nothing,
|
color = st === :wireframe ? up_color(get_linecolor(series, 1)) : nothing,
|
||||||
lines = st === :wireframe,
|
zscale = zscale,
|
||||||
|
lines = lines,
|
||||||
)
|
)
|
||||||
return UnicodePlots.surfaceplot(x, y, Array(series[:z]); kw...)
|
return UnicodePlots.surfaceplot(x, y, Array(series[:z]); kw...)
|
||||||
elseif st === :mesh3d
|
elseif st === :mesh3d
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user