You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to "crop" a plotted image using xlims and ylims. Everything works as expected when using yflip=false, but with yflip=true (default), the image is cropped in the wrong side. Furthermore, the image is shifted relative to the plot's coordinate system (notice how the orange point seems to shift on the second plot).
using Plots
using FileIO, HTTP, ImageIO
bg_img2 =load(HTTP.URI("https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/GoldenGateBridge-001.jpg/640px-GoldenGateBridge-001.jpg"));
plot(bg_img2)
scatter!([385], [315])
I'm running into this bug on the latest v1.40.x series. The code worked fine on Plots v1.39 so it was a recent regression. This isn't specific to ylims/yflip either since xlims/xflip also have the same problem:
using Colors
using OffsetArrays
using Plots
p =plot(OffsetArray(rand(Gray, 11, 11), 100:110, 100:110),
xlim = (0, 150), ylim = (0, 150), xflip =true, yflip =true, title ="Plots $ver")
savefig(p, "plots_$(ver).png")
p
Same code running on Plots v1.39.0:
vs
Plots v1.40.4:
EDIT: Plots v1.40.0 has this error too. So it was introduced between 1.39.0 and 1.40.0
Details
I'm trying to "crop" a plotted image using
xlims
andylims
. Everything works as expected when usingyflip=false
, but withyflip=true
(default), the image is cropped in the wrong side. Furthermore, the image is shifted relative to the plot's coordinate system (notice how the orange point seems to shift on the second plot).It seems to me that
yflip=true
is not correnctly respected when specifyingylims
.Backends
This bug occurs on ( insert
x
below )Versions
Plots.jl version: v1.40.2
Backend version (
]st -m <backend(s)>
): GR v0.73.3Output of
versioninfo()
:The text was updated successfully, but these errors were encountered: