wireframes

This commit is contained in:
Simon Christ 2019-11-22 14:08:45 +01:00
parent c39a6d8ec3
commit 195c6d601c
2 changed files with 8 additions and 6 deletions

View File

@ -233,10 +233,7 @@ end
# function args
args = if st == :contour
opt[:x], opt[:y], opt[:z].surf'
elseif st == :heatmap || st == :surface
@show opt[:x]
@show opt[:y]
@show opt[:z]
elseif st in (:heatmap, :surface, :wireframe)
surface_to_vecs(opt[:x], opt[:y], opt[:z])
elseif is3d(st)
opt[:x], opt[:y], opt[:z]
@ -313,7 +310,9 @@ function pgfx_series_coordinates!(st_val::Val{:volume}, segment_opt, opt, args)
return PGFPlotsX.Coordinates(args...)
end
function pgfx_series_coordinates!(st_val::Val{:wireframe}, segment_opt, opt, args)
push!( segment_opt, "mesh" => nothing )
push!( segment_opt, "mesh" => nothing,
"mesh/rows" => length(opt[:x])
)
return PGFPlotsX.Coordinates(args...)
end
function pgfx_series_coordinates!(st_val::Val{:shape}, segment_opt, opt, args)

View File

@ -76,7 +76,7 @@ end
histogram2d(randn(10000), randn(10000), nbins=20)
# TODO: should work, when heatmaps works?
end # testset
@testset "Heatmap" begin
@testset "Heatmap-like" begin
xs = [string("x", i) for i = 1:10]
ys = [string("y", i) for i = 1:4]
z = float((1:4) * reshape(1:10, 1, :))
@ -86,6 +86,9 @@ end
@test Plots.pgfx_axes(pgfx_plot.o)[1]["colorbar"] === nothing
@test Plots.pgfx_axes(pgfx_plot.o)[1]["colormap name"] == "plots1"
end
pgfx_plot = wireframe(xs, ys, z, aspect_ratio=1)
# TODO: clims are wrong
end # testset
@testset "Contours" begin
x = 1:0.5:20