# \[?\] Restrict the figure in the frame of DiscretePlot?

**URL:** <https://community.wolfram.com/t/restrict-the-figure-in-the-frame-of-discreteplot/12317>\
**Category:** Questions\
**Tags:** discrete-mathematics, graphics-and-visualization\
**Created:** [April 13, 2018, 8:36pm UTC](https://community.wolfram.com/t/restrict-the-figure-in-the-frame-of-discreteplot/12317 "2018-04-13T20:36:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qxw151330](https://avatars.discourse-cdn.com/v4/letter/q/df705f/32.png) [@qxw151330](https://community.wolfram.com/u/qxw151330)\
**Post date:** [April 13, 2018, 8:36pm UTC](https://community.wolfram.com/t/restrict-the-figure-in-the-frame-of-discreteplot/12317/1 "2018-04-13T20:36:49Z")

</div>

Consider the following code:

```
DiscretePlot[PrimePi[k], {k, 1, 50}, PlotRange -> {1, 10}, 
         Frame -> True, Joined -> True]

```

[Untitled-1.bmp](https://community.wolfram.com/uploads/short-url/ey1M57kSfX6BFeFMcJmlhIGBs9F.bmp) (83.5 KB)

I met this kind of problem in my research. Above is just an simple example.  
How can I restrict the plotrange into the frame not having something out side on the tick label?  
Thanks!

---

<div class="post-metadata">

**Author:** ![neils](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/neils/32/20595_2.png) [@neils](https://community.wolfram.com/u/neils)\
**Post date:** [April 14, 2018, 3:09am UTC](https://community.wolfram.com/t/restrict-the-figure-in-the-frame-of-discreteplot/12317/2 "2018-04-14T03:09:16Z")

</div>

Add

```
PlotRangeClipping -> True

```

Regards

---

<div class="post-metadata">

**Author:** ![qxw151330](https://avatars.discourse-cdn.com/v4/letter/q/df705f/32.png) [@qxw151330](https://community.wolfram.com/u/qxw151330)\
**Post date:** [April 14, 2018, 3:24am UTC](https://community.wolfram.com/t/restrict-the-figure-in-the-frame-of-discreteplot/12317/3 "2018-04-14T03:24:44Z")

</div>

Thank you!
