Add :pixel to native seriestype for pyplot and gr

This commit is contained in:
Lakshya Khatri 2020-07-29 16:08:04 +05:30
parent 55afb20a09
commit bb936346e4
3 changed files with 11 additions and 1 deletions

View File

@ -355,6 +355,7 @@ const _gr_seriestype = [
:wireframe, :wireframe,
:volume, :volume,
:shape, :shape,
:pixel,
] ]
const _gr_style = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot] const _gr_style = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot]
const _gr_marker = _allMarkers const _gr_marker = _allMarkers
@ -566,6 +567,7 @@ const _pyplot_seriestype = [
:scatter3d, :scatter3d,
:surface, :surface,
:wireframe, :wireframe,
:pixel,
] ]
const _pyplot_style = [:auto, :solid, :dash, :dot, :dashdot] const _pyplot_style = [:auto, :solid, :dash, :dot, :dashdot]
const _pyplot_marker = vcat(_allMarkers, :pixel) const _pyplot_marker = vcat(_allMarkers, :pixel)

View File

@ -479,6 +479,11 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
end end
end end
if st == :pixel
handle = ax."plot"(x, y, ",")
push!(handles, handle)
end
# add markers? # add markers?
if series[:markershape] != :none && st in (:path, :scatter, :path3d, if series[:markershape] != :none && st in (:path, :scatter, :path3d,
:scatter3d, :steppre, :steppost, :scatter3d, :steppre, :steppost,

View File

@ -174,12 +174,15 @@ end
end end
@deps scatterpath path scatter @deps scatterpath path scatter
# ---------------------------------------------------------------------------
# pixel
@recipe function f(::Type{Val{:pixel}}, x, y, z) @recipe function f(::Type{Val{:pixel}}, x, y, z)
x := x x := x
y := y y := y
seriestype := :pixel
markersize := 1 markersize := 1
markerstrokewidth --> 0 markerstrokewidth --> 0
seriestype := :scatter
() ()
end end