# Undesired empty gaps when plotting TF1 functions

**URL:** <https://root-forum.cern.ch/t/undesired-empty-gaps-when-plotting-tf1-functions/62015>\
**Category:** ROOT\
**Tags:** graphics\
**Created:** [October 25, 2024, 8:52am UTC](https://root-forum.cern.ch/t/undesired-empty-gaps-when-plotting-tf1-functions/62015 "2024-10-25T08:52:40Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [October 25, 2024, 10:29am UTC](https://root-forum.cern.ch/t/undesired-empty-gaps-when-plotting-tf1-functions/62015/3 "2024-10-25T10:29:41Z")

</div>

See

> [@Two plotting aesthetics questions (TGraph and TAxis)](https://root-forum.cern.ch/t/two-plotting-aesthetics-questions-tgraph-and-taxis/61900/5):
>
> For the function line issue, it’s because your functions are defined from 9.5 (or 10.5 as you would like) to 200 (even though you are only plotting up to 37), and by default ROOT draws TF1 by sampling 100 points in x, so there aren’t enough points; you can change that number with TF1::SetNpx: [https://root.cern/doc/master/classTF1.html#a6a04facaa58306988a3189b4e8713aa5](https://root.cern/doc/master/classTF1.html#a6a04facaa58306988a3189b4e8713aa5) For your case, you could increase that npx (around 500 seems to look ok), or reduce the upper limit of your functions (e.g. to …

---

_[View the full topic](https://root-forum.cern.ch/t/undesired-empty-gaps-when-plotting-tf1-functions/62015)._
