@@ -72,7 +72,9 @@ function contour(x, y, z, level::Number; VT=nothing)
72
72
if ! (axes (x) == (axes (z,1 ),) && axes (y) == (axes (z,2 ),) || axes (x) == axes (y) == axes (z))
73
73
throw (ArgumentError (" Incompatible input axes in `Contour.contour`." ))
74
74
end
75
- VT = VT === nothing ? NTuple{2 ,promote_type (map (eltype, (x, y, z))... )} : VT
75
+ ET = promote_type (map (eltype, (x, y, z))... )
76
+ ET = ET <: Integer ? Float64 : ET
77
+ VT = VT === nothing ? NTuple{2 ,ET} : VT
76
78
trace_contour (x, y, z, level, get_level_cells (z, level), VT)
77
79
end
78
80
@@ -84,23 +86,27 @@ You'll usually call [`levels`](@ref) on the output of `contours`.
84
86
function contours end
85
87
86
88
"""
87
- `contours(x,y,z,levels)` Trace the contour levels indicated by the `levels`
88
- argument.
89
+ contours(x,y,z,levels;[VT])
90
+ Trace the contour levels indicated by the `levels` argument.
91
+ The extracted vertex type maybe be specified by the `VT` keyword.
89
92
"""
90
- contours (x, y, z, levels) = ContourCollection ([contour (x, y, z, l) for l in levels])
93
+ contours (x, y, z, levels; VT = nothing ) = ContourCollection ([contour (x, y, z, l; VT = VT ) for l in levels])
91
94
92
95
"""
93
- `contours(x,y,z,Nlevels::Integer)` Trace `Nlevels` contour levels at heights
96
+ contours(x,y,z,Nlevels::Integer;[VT])
97
+
98
+ Trace `Nlevels` contour levels at heights
94
99
chosen by the library (using the [`contourlevels`](@ref) function).
100
+ The extracted vertex type maybe be specified by the `VT` keyword.
95
101
"""
96
- function contours (x, y, z, Nlevels:: Integer )
97
- contours (x, y, z, contourlevels (z, Nlevels))
102
+ function contours (x, y, z, Nlevels:: Integer ;VT = nothing )
103
+ contours (x, y, z, contourlevels (z, Nlevels); VT = VT )
98
104
end
99
105
100
106
"""
101
- `contours(x,y,z)` Trace 10 automatically chosen contour levels.
107
+ `contours(x,y,z;[VT] )` Trace 10 automatically chosen contour levels.
102
108
"""
103
- contours (x, y, z) = contours (x, y, z, 10 )
109
+ contours (x, y, z; VT = nothing ) = contours (x, y, z, 10 ; VT = VT )
104
110
105
111
"""
106
112
`contourlevels(z,n)` Examines the values of `z` and chooses `n` evenly spaced
0 commit comments