Update pyplot.jl

Adds a half-pixel margin to the extent for image plots so that the pixel coordinates match the grid, i.e. the center of each square pixel lies over its integral index numbers, and each square covers half a pixel before and after that.
This commit is contained in:
Nicolau Leal Werneck 2019-10-21 23:03:44 +02:00 committed by GitHub
parent 0ca5a30b8a
commit d0a73eb862
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -756,7 +756,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
cmap = py_colormap(cgrad([:black, :white])),
vmin = 0.0,
vmax = 1.0,
extent = (xmin, xmax, ymax, ymin)
extent = (xmin-0.5, xmax+0.5, ymax+0.5, ymin-0.5)
)
push!(handles, handle)