Skip to content

Commit d4ac30e

Browse files
committed
fix incorrect orientation of grayscale
1 parent d3a21ee commit d4ac30e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/matrices/plot.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ recurrent points contained in it. The levels of gray are coded as numbers of the
155155
same type as the black and white codes.
156156
157157
It is advised to use `width, height` arguments for large matrices otherwise
158-
plots using functions like e.g. `imshow` could be misleading.
158+
plots using functions like e.g. `heatmap` could be misleading.
159159
"""
160160
function grayscale(R, bwcode::Tuple{TT,T}=(0.0,1.0);
161161
exactsize=false, kwargs...) where {TT<:Real, T<:Real}
@@ -193,4 +193,6 @@ function grayscale(R, bwcode::Tuple{TT,T}=(0.0,1.0);
193193
# Change to color scale
194194
p .= bwcode[1].*p .+ bwcode[2].*(1 .- p)
195195
pt = (T<:Integer) ? round.(T, p) : T.(p)
196+
# need to flip `y` so that diagonal is in the correct way...
197+
return reverse(pt; dims = 2)
196198
end

0 commit comments

Comments
 (0)