Skip to content

Commit ebe4899

Browse files
committed
Ensure that colorbarticks makeisolevels always contain the limits
1 parent 3a06f7e commit ebe4899

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GridVisualizeTools"
22
uuid = "5573ae12-3b76-41d9-b48c-81d0b6e61cc5"
33
authors = ["Jürgen Fuhrmann <juergen-fuhrmann@web.de>"]
4-
version = "1.0.0"
4+
version = "1.1.0"
55

66
[deps]
77
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"

src/planeslevels.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Update levels, limits, colorbartics based on vector given in func.
4848
4949
- if `limits[1]>limits[2]`, replace it by `extrema(func)`.
5050
- if levels is a number, replace it with a linear range in `limits` of length levels+2
51-
- if colorbarticks is `nothing` replace it with levels, otherwise, if it is a number, replace it
52-
with a linear range of corresponding length
51+
- if colorbarticks is `nothing` replace it with levels and add the limits to the result
52+
otherwise, if it is a number, replace it with a linear range of corresponding length
5353
"""
5454
function makeisolevels(func::Vector{T}, levels, limits, colorbarticks) where {T <: Number}
5555
makeisolevels([func], levels, limits, colorbarticks)
@@ -66,7 +66,7 @@ function makeisolevels(funcs::Vector{T}, levels, limits, colorbarticks) where {T
6666
end
6767

6868
if colorbarticks == nothing
69-
colorbarticks = levels
69+
colorbarticks = unique([limits[1], levels..., limits[2]])
7070
elseif isa(colorbarticks, Number)
7171
colorbarticks = collect(limits[1]:((limits[2] - limits[1]) / (colorbarticks - 1)):limits[2])
7272
end

0 commit comments

Comments
 (0)