Merge pull request #1281 from hayatoikoma/fix_grayimg
Fix the display of an grayscale image for image-nonsupported backends
This commit is contained in:
commit
34dedd36e6
@ -306,9 +306,9 @@ end
|
|||||||
# # images - grays
|
# # images - grays
|
||||||
|
|
||||||
@recipe function f(mat::AMat{T}) where T<:Gray
|
@recipe function f(mat::AMat{T}) where T<:Gray
|
||||||
|
n, m = size(mat)
|
||||||
if is_seriestype_supported(:image)
|
if is_seriestype_supported(:image)
|
||||||
seriestype := :image
|
seriestype := :image
|
||||||
n, m = size(mat)
|
|
||||||
SliceIt, 1:m, 1:n, Surface(mat)
|
SliceIt, 1:m, 1:n, Surface(mat)
|
||||||
else
|
else
|
||||||
seriestype := :heatmap
|
seriestype := :heatmap
|
||||||
@ -371,7 +371,7 @@ end
|
|||||||
end
|
end
|
||||||
|
|
||||||
# try some intervals over which the function may be defined
|
# try some intervals over which the function may be defined
|
||||||
function tryrange(F::AbstractArray, vec)
|
function tryrange(F::AbstractArray, vec)
|
||||||
rets = [tryrange(f, vec) for f in F] # get the preferred for each
|
rets = [tryrange(f, vec) for f in F] # get the preferred for each
|
||||||
maxind = maximum(indexin(rets, vec)) # get the last attempt that succeeded (most likely to fit all)
|
maxind = maximum(indexin(rets, vec)) # get the last attempt that succeeded (most likely to fit all)
|
||||||
rets .= [tryrange(f, vec[maxind:maxind]) for f in F] # ensure that all functions compute there
|
rets .= [tryrange(f, vec[maxind:maxind]) for f in F] # ensure that all functions compute there
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user