Compare commits
1 Commits
master
...
bbs/pgfx-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
755575b988 |
@ -287,6 +287,7 @@ const _series_defaults = KW(
|
|||||||
:hover => nothing, # text to display when hovering over the data points
|
:hover => nothing, # text to display when hovering over the data points
|
||||||
:stride => (1,1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride.
|
:stride => (1,1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride.
|
||||||
:connections => nothing, # tuple of arrays to specifiy connectivity of a 3d mesh
|
:connections => nothing, # tuple of arrays to specifiy connectivity of a 3d mesh
|
||||||
|
:series_projection => :none, # allows e.g. projection to planes in a 3D plot
|
||||||
:extra_kwargs => Dict()
|
:extra_kwargs => Dict()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -202,7 +202,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
|||||||
for series in series_list(sp)
|
for series in series_list(sp)
|
||||||
if hascolorbar(series)
|
if hascolorbar(series)
|
||||||
cg = get_colorgradient(series)
|
cg = get_colorgradient(series)
|
||||||
cm = pgfx_colormap(get_colorgradient(series))
|
cm = pgfx_colormap(cg)
|
||||||
PGFPlotsX.push_preamble!(
|
PGFPlotsX.push_preamble!(
|
||||||
pgfx_plot.the_plot,
|
pgfx_plot.the_plot,
|
||||||
"""\\pgfplotsset{
|
"""\\pgfplotsset{
|
||||||
@ -564,10 +564,34 @@ function pgfx_add_series!(::Val{:filledcontour}, axis, series_opt, series, serie
|
|||||||
end
|
end
|
||||||
|
|
||||||
function pgfx_add_series!(::Val{:contour3d}, axis, series_opt, series, series_func, opt)
|
function pgfx_add_series!(::Val{:contour3d}, axis, series_opt, series, series_func, opt)
|
||||||
|
isproj = opt[:series_projection] != :none
|
||||||
|
if isproj
|
||||||
|
proj_letter, lim_value = getproperty(
|
||||||
|
(
|
||||||
|
xy = (:z, zlims(opt[:subplot])[1]),
|
||||||
|
yx = (:z, zlims(opt[:subplot])[2]),
|
||||||
|
yz = (:x, xlims(opt[:subplot])[1]),
|
||||||
|
zy = (:x, xlims(opt[:subplot])[2]),
|
||||||
|
xz = (:y, ylims(opt[:subplot])[1]),
|
||||||
|
zx = (:y, ylims(opt[:subplot])[2]),
|
||||||
|
),
|
||||||
|
get(opt, :series_projection, :xz),
|
||||||
|
)
|
||||||
|
push!(series_opt,
|
||||||
|
"mesh" => nothing,
|
||||||
|
"mesh/check" => false,
|
||||||
|
"mesh/cols" => size(opt[:z], 1),
|
||||||
|
"mesh/rows" => size(opt[:z], 2),
|
||||||
|
"patch type" => "line",
|
||||||
|
"point meta" => "rawz",
|
||||||
|
"$proj_letter filter/.code" => "\\def\\pgfmathresult{$lim_value}"
|
||||||
|
)
|
||||||
|
else
|
||||||
push!(
|
push!(
|
||||||
series_opt,
|
series_opt,
|
||||||
"contour prepared" => PGFPlotsX.Options("labels" => opt[:contour_labels]),
|
"contour prepared" => PGFPlotsX.Options("labels" => opt[:contour_labels]),
|
||||||
)
|
)
|
||||||
|
end
|
||||||
args = pgfx_series_arguments(series, opt)
|
args = pgfx_series_arguments(series, opt)
|
||||||
series_plot = series_func(series_opt, PGFPlotsX.Table(Contour.contours(args..., opt[:levels])))
|
series_plot = series_func(series_opt, PGFPlotsX.Table(Contour.contours(args..., opt[:levels])))
|
||||||
push!(axis, series_plot)
|
push!(axis, series_plot)
|
||||||
|
|||||||
@ -531,7 +531,7 @@ function get_colorgradient(series::Series)
|
|||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
if st in (:surface, :heatmap) || isfilledcontour(series)
|
if st in (:surface, :heatmap) || isfilledcontour(series)
|
||||||
series[:fillcolor]
|
series[:fillcolor]
|
||||||
elseif st in (:contour, :wireframe)
|
elseif st in (:contour, :wireframe, :contour3d)
|
||||||
series[:linecolor]
|
series[:linecolor]
|
||||||
elseif series[:marker_z] !== nothing
|
elseif series[:marker_z] !== nothing
|
||||||
series[:markercolor]
|
series[:markercolor]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user