From bc4d19b3883b734203f99f589c2161331924afe8 Mon Sep 17 00:00:00 2001 From: Josef Heinen Date: Mon, 19 Aug 2024 09:32:42 +0200 Subject: [PATCH] Set clip region for rectangular/polar plots --- src/GR.jl | 3 +++ src/jlgr.jl | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/GR.jl b/src/GR.jl index ba250ac..150d385 100644 --- a/src/GR.jl +++ b/src/GR.jl @@ -3646,6 +3646,9 @@ const AXES_SIMPLE_AXES = 1 const AXES_TWIN_AXES = 2 const AXES_WITH_GRID = 4 +const REGION_RECTANGLE = 0 +const REGION_ELLIPSE = 1 + # GR3 functions include("gr3.jl") diff --git a/src/jlgr.jl b/src/jlgr.jl index d31ae4d..fc9d4b6 100644 --- a/src/jlgr.jl +++ b/src/jlgr.jl @@ -503,8 +503,10 @@ function set_window(kind, plt=plt[]) plt.kvs[:window] = xmin, xmax, ymin, ymax if !(kind === :polar || kind === :polarhist || kind === :polarheatmap || kind === :nonuniformpolarheatmap) GR.setwindow(xmin, xmax, ymin, ymax) + GR.setclipregion(REGION_RECTANGLE) else GR.setwindow(-1, 1, -1, 1) + GR.setclipregion(REGION_ELLIPSE) end if kind === :wireframe || kind === :surface || kind === :plot3 || kind === :scatter3 || kind === :trisurf || kind === :volume rotation = get(plt.kvs, :rotation, 40)