# How, in python, to do "Adjust the Plot Viewer's field of view to match the extent of the Plot axes"?

**URL:** <https://discourse.slicer.org/t/how-in-python-to-do-adjust-the-plot-viewers-field-of-view-to-match-the-extent-of-the-plot-axes/9106>\
**Category:** Support\
**Created:** [November 11, 2019, 8:50pm UTC](https://discourse.slicer.org/t/how-in-python-to-do-adjust-the-plot-viewers-field-of-view-to-match-the-extent-of-the-plot-axes/9106 "2019-11-11T20:50:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 11, 2019, 8:50pm UTC](https://discourse.slicer.org/t/how-in-python-to-do-adjust-the-plot-viewers-field-of-view-to-match-the-extent-of-the-plot-axes/9106/1 "2019-11-11T20:50:22Z")

</div>

Operating system: windows  
Slicer version: 4.11.0  
Expected behavior: reset the focal of the quantitative view through Python  
Actual behavior: click button

Hi all,  
I know the slice views, I may use: sliceWidget(“Red”).fitSliceToBackgrond() to do the reset focal view;  
I know the 3d-view, I may use: threeDView.resetFocalPoint(),

what’s the similar control function inside the quantitative view (as shown in the following image) ?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/e/ee31accb0fb14c0994f66f4e394dee894457baa9.png)

Thanks a lot, Aiden

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 12, 2019, 12:19am UTC](https://discourse.slicer.org/t/how-in-python-to-do-adjust-the-plot-viewers-field-of-view-to-match-the-extent-of-the-plot-axes/9106/2 "2019-11-12T00:19:04Z")

</div>

Plot view axes can be reset to include the entire plot using `plotWidget.plotView().fitToContent()` (see [documentation](https://apidocs.slicer.org/master/classqMRMLPlotView.html#a4238275e4e9114eeeb2f7ae14bacb11b)).

---

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 12, 2019, 1:34pm UTC](https://discourse.slicer.org/t/how-in-python-to-do-adjust-the-plot-viewers-field-of-view-to-match-the-extent-of-the-plot-axes/9106/3 "2019-11-12T13:34:13Z")

</div>

Thanks a lot, Andras!  
Aiden
