Skip to content

Commit

Permalink
Set clip region for rectangular/polar plots
Browse files Browse the repository at this point in the history
  • Loading branch information
jheinen committed Aug 19, 2024
1 parent a2db49f commit 4c60d12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/GR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 2 additions & 0 deletions src/jlgr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(GR.REGION_RECTANGLE)
else
GR.setwindow(-1, 1, -1, 1)
GR.setclipregion(GR.REGION_ELLIPSE)
end
if kind === :wireframe || kind === :surface || kind === :plot3 || kind === :scatter3 || kind === :trisurf || kind === :volume
rotation = get(plt.kvs, :rotation, 40)
Expand Down

0 comments on commit 4c60d12

Please sign in to comment.