Message Boards Message Boards

2
|
3744 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Non-proper clipping at PlotRange edge

I've noticed that in some situations the clipping is not done properly, despite the explicit setting PlotRangeClipping->True:
So I plot a simple plot:
SetDirectory[NotebookDirectory[]];
ListPlot[Table[{x, Sin[x]}, {x, -0.5, 6, 0.2}],
PlotRange -> {{0, 5.1}, {-1, 1}}, Frame -> True,
ImageSize -> {200, 150}, Joined -> True,
ImagePadding -> {{40, 5}, {40, 5}}, PlotRangeClipping -> True]
(*Export["myfig.eps", %];*)
creating:

You already see that it is not properly clipped: which is also visible in the exported EPS figure:


Is there a simple fix for this or can I specify the clipping-box myself? Is there a general way to 'mask' something? Like you can do in Photoshop/Illustrator and others. Those commands would be handy in many occassions. 

Regards, 

Sander
POSTED BY: Sander Huisman
4 Replies
Thanks Udo, forgot to mention I'm running the newest Mac OSX (mavericks), and Mathematica 9.0.1.0.
POSTED BY: Sander Huisman
Table[p =
  ListPlot[Table[{x, Sin[x]}, {x, -0.5, 6, 0.2}],
   PlotRange -> {{0, 5.1}, {-1, 1}}, Frame -> True,
   ImageSize -> {200, 150}, Joined -> True,
   ImagePadding -> {{q, 5}, {40, 5}}, PlotRangeClipping -> True];
Export["myfig" <> ToString[q] <> ".eps", p], {q, 20, 50, 1}]
Thanks Udo Krause for the input. 
Now I change the imagepadding on the left side, and output each:
To summarize here is a list of when the clipping is correct or wrong on the left/right side:
 #:  left/right
20:  wrong/wrong
21: correct/correct
22: wrong/wrong
23: correct/correct
24: wrong/wrong
25: correct/correct
26: correct/correct
27: wrong/correct
28: correct/correct
29: correct/correct
30: correct/correct
31: correct/correct
32: correct/wrong
33: wrong/correct
34: wrong/wrong
35: correct/correct
36: wrong/correct
37: correct/corect
38: correct/correct
39: wrong/correct
40: wrong/correct
41: correct/correct
42: correct/correct
43: correct/correct
44: wrong/correct
45: correct/correct
46: correct/wrong
47: correc/correct
48: correct/correct
49: correct/corect
50: correct/correct
POSTED BY: Sander Huisman
Yeah, but what's your system you are running with? You will have no other chance than to work around this (and probably report a bug to Wolfram Inc.).
POSTED BY: Udo Krause
Here with Mma 9.0.1.0 on windows 7 a perfect clip is seen.
POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract