_shape_keys for consistent shape ordering
This commit is contained in:
parent
10d218089f
commit
9fd09924eb
@ -86,7 +86,7 @@ const _allStyles = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot]
|
|||||||
:ddd => :dashdotdot,
|
:ddd => :dashdotdot,
|
||||||
)
|
)
|
||||||
|
|
||||||
const _allMarkers = vcat(:none, :auto, sort(collect(keys(_shapes))))
|
const _allMarkers = vcat(:none, :auto, _shape_keys) #sort(collect(keys(_shapes))))
|
||||||
@compat const _markerAliases = KW(
|
@compat const _markerAliases = KW(
|
||||||
:n => :none,
|
:n => :none,
|
||||||
:no => :none,
|
:no => :none,
|
||||||
|
|||||||
@ -100,6 +100,27 @@ function makearrowhead(angle; h = 2.0, w = 0.4)
|
|||||||
from_polar(angle + 0.5π, w) - tip, (0,0)])
|
from_polar(angle + 0.5π, w) - tip, (0,0)])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
const _shape_keys = Symbol[
|
||||||
|
:circle,
|
||||||
|
:rect,
|
||||||
|
:star5,
|
||||||
|
:diamond,
|
||||||
|
:hexagon,
|
||||||
|
:cross,
|
||||||
|
:xcross,
|
||||||
|
:utriangle,
|
||||||
|
:dtriangle,
|
||||||
|
:pentagon,
|
||||||
|
:heptagon,
|
||||||
|
:octagon,
|
||||||
|
:star4,
|
||||||
|
:star6,
|
||||||
|
:star7,
|
||||||
|
:star8,
|
||||||
|
:vline,
|
||||||
|
:hline,
|
||||||
|
]
|
||||||
|
|
||||||
const _shapes = KW(
|
const _shapes = KW(
|
||||||
:circle => makeshape(20),
|
:circle => makeshape(20),
|
||||||
:rect => makeshape(4, offset=-0.25),
|
:rect => makeshape(4, offset=-0.25),
|
||||||
|
|||||||
@ -115,15 +115,17 @@ PlotExample("Line types",
|
|||||||
PlotExample("Line styles",
|
PlotExample("Line styles",
|
||||||
"",
|
"",
|
||||||
[:(begin
|
[:(begin
|
||||||
styles = setdiff(supported_styles(), [:auto])'
|
styles = filter(s -> s in supported_styles(), [:solid, :dash, :dot, :dashdot, :dashdotdot])'
|
||||||
plot(cumsum(randn(20,length(styles)),1), style=:auto, label=map(string,styles), w=5)
|
n = length(styles)
|
||||||
|
y = cumsum(randn(20,n),1)
|
||||||
|
plot(y, line = (5, styles), label = map(string,styles))
|
||||||
end)]
|
end)]
|
||||||
),
|
),
|
||||||
|
|
||||||
PlotExample("Marker types",
|
PlotExample("Marker types",
|
||||||
"",
|
"",
|
||||||
[:(begin
|
[:(begin
|
||||||
markers = setdiff(supported_markers(), [:none,:auto,Shape])'
|
markers = filter(m -> m in supported_markers(), Plots._shape_keys)'
|
||||||
n = length(markers)
|
n = length(markers)
|
||||||
x = linspace(0,10,n+2)[2:end-1]
|
x = linspace(0,10,n+2)[2:end-1]
|
||||||
y = repmat(reverse(x)', n, 1)
|
y = repmat(reverse(x)', n, 1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user