From 555145a65099185efa30247a074ea44d92d3df5c Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Mon, 19 Sep 2016 22:23:35 -0400 Subject: [PATCH] added pixel marker for pyplot --- src/backends/pyplot.jl | 3 ++- src/utils.jl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 2b3d923a..4f801fbb 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -41,7 +41,7 @@ const _pyplot_seriestype = [ :contour, :contour3d, :path3d, :scatter3d, :surface, :wireframe ] const _pyplot_style = [:auto, :solid, :dash, :dot, :dashdot] -const _pyplot_marker = _allMarkers +const _pyplot_marker = vcat(_allMarkers, :pixel) const _pyplot_scale = [:identity, :ln, :log2, :log10] is_marker_supported(::PyPlotBackend, shape::Shape) = true @@ -189,6 +189,7 @@ function py_marker(marker::Symbol) marker == :pentagon && return "p" marker == :hexagon && return "h" marker == :octagon && return "8" + marker == :pixel && return "," haskey(_shapes, marker) && return py_marker(_shapes[marker]) warn("Unknown marker $marker") diff --git a/src/utils.jl b/src/utils.jl index 86001d78..d5a7757d 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -498,7 +498,7 @@ trueOrAllTrue(f::Function, x) = f(x) allLineTypes(arg) = trueOrAllTrue(a -> get(_typeAliases, a, a) in _allTypes, arg) allStyles(arg) = trueOrAllTrue(a -> get(_styleAliases, a, a) in _allStyles, arg) -allShapes(arg) = trueOrAllTrue(a -> get(_markerAliases, a, a) in _allMarkers, arg) || +allShapes(arg) = trueOrAllTrue(a -> is_marker_supported(get(_markerAliases, a, a)), arg) || trueOrAllTrue(a -> isa(a, Shape), arg) allAlphas(arg) = trueOrAllTrue(a -> (typeof(a) <: Real && a > 0 && a < 1) || (typeof(a) <: AbstractFloat && (a == zero(typeof(a)) || a == one(typeof(a)))), arg)