Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Mathematica 7. In a Graphics environment I am setting Frame -> True (and using FrameLabel -> {"x", "y"} and PlotLabel -> "My Title", etc) so that I can see length scales in Graphics environments.

Suppose that I create a Disk of radius 0.9, centered at the origin. I have set PlotRange -> {{-1, 1}, {-1, 1}}. The result looks nice:

  Cyan, Disk[{0, 0}, 0.9]
 PlotRange -> {{-1, 1}, {-1, 1}}, Frame -> True, 
 FrameLabel -> {"x", "y"}, PlotLabel -> "My Disk"]

Disk 1

Now, however, suppose that I want to create a Disk that is not entirely contained in Frame. For example, I might leave PlotRange -> {{-1, 1}, {-1, 1}} and increase the Disk radius from 0.9 to 1.2. However, in the resulting image, the Disk goes beyond the boundaries of the Frame:

  Cyan, Disk[{0, 0}, 1.2]
 PlotRange -> {{-1, 1}, {-1, 1}}, Frame -> True, 
 FrameLabel -> {"x", "y"}, PlotLabel -> "My Disk"]

Disk 2

Is there any way that I can direct Mathematica to chop off parts of the Graphics objects that exist outside of the Frame? Thanks for your time.

share|improve this question
up vote 9 down vote accepted

If I have understood correctly then PlotRangeClipping -> True is what you need:

Graphics[{Cyan, Disk[{0, 0}, 1.2]}, PlotRange -> {{-1, 1}, {-1, 1}}, 
 Frame -> True, FrameLabel -> {"x", "y"}, PlotLabel -> "My Disk", 
 PlotRangeClipping -> True]

enter image description here

share|improve this answer

Though not strictly a way to clip graphics, a similar result for a disk can be obtained with RegionPlot which automatically frames and clips regions.

r = 1.2;
RegionPlot[x^2+y^2 <= r^2, {x,-r,r}, {y,-r,r},
PlotRange->{{-1,1},{-1,1}}, PlotLabel->"My Disk"]

Mathematica graphics

share|improve this answer
The reason is still the same as in Mike's answer :) RegionPlot just has it set to True by default. See Options[RegionPlot, PlotRangeClipping] and Options[Graphics, PlotRangeClipping] – R. M. Jan 13 '13 at 15:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.