Skip to content

Commit

Permalink
Fix clipping problem for polar axes
Browse files Browse the repository at this point in the history
  • Loading branch information
jheinen committed Aug 6, 2024
1 parent 748e71f commit 2b20e1f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/jlgr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,14 @@ function draw_polar_axes(plt=plt[])
n = trunc(Int, (rmax - rmin) / tick)
for i in 0:n
r = rmin + i * tick / (rmax - rmin)
if i % 2 == 0
GR.setlinecolorind(88)
if i > 0
if 0 < r < 1
if i % 2 == 0
GR.setlinecolorind(88)
GR.drawarc(-r, r, -r, r, 0, 360)
else
GR.setlinecolorind(90)
GR.drawarc(-r, r, -r, r, 0, 360)
end
else
GR.setlinecolorind(90)
GR.drawarc(-r, r, -r, r, 0, 360)
end
end

Expand Down Expand Up @@ -688,6 +688,11 @@ function draw_polar_axes(plt=plt[])
GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_TOP)
text(0.5 * (viewport[1] + viewport[2]), vp[4] - 0.02, plt.kvs[:title])
end

GR.setclip(0)
GR.setlinecolorind(88)
GR.drawarc(-1, 1, -1, 1, 0, 360)

GR.restorestate()
end

Expand Down

0 comments on commit 2b20e1f

Please sign in to comment.