# How to setup a chart range of X/Y axies, via python scripts?

**URL:** <https://discourse.slicer.org/t/how-to-setup-a-chart-range-of-x-y-axies-via-python-scripts/12869>\
**Category:** Support\
**Created:** [August 6, 2020, 9:06am UTC](https://discourse.slicer.org/t/how-to-setup-a-chart-range-of-x-y-axies-via-python-scripts/12869 "2020-08-06T09:06:09Z")\
**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:** [August 6, 2020, 9:06am UTC](https://discourse.slicer.org/t/how-to-setup-a-chart-range-of-x-y-axies-via-python-scripts/12869/1 "2020-08-06T09:06:09Z")

</div>

Operating system: windows  
Slicer version: 4.11.0  
Expected behavior: change X/Y axes minimum and maximum in charts  
Actual behavior:

Hi all,  
I am still trying to use a Chart (slicer.vtkMRMLChartNode()) but I am stuck at the settings of its properties such as: how to reset up the minimum and maximum in a chart? Say, by default I have a range of x-axis from 8 to 10, now I would like to set it up as from 0 to 11.

Thanks a lot.

---

<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:** [August 6, 2020, 1:25pm UTC](https://discourse.slicer.org/t/how-to-setup-a-chart-range-of-x-y-axies-via-python-scripts/12869/2 "2020-08-06T13:25:49Z")

</div>

Hahha, forget about this:  
chartNode.SetYAxisRangeAuto(False)  
chartNode.SetYAxisRange(0, 4e5)

---

<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:** [August 6, 2020, 1:48pm UTC](https://discourse.slicer.org/t/how-to-setup-a-chart-range-of-x-y-axies-via-python-scripts/12869/3 "2020-08-06T13:48:27Z")

</div>

Thanks for sharing the solution. You can find further information and examples here:

- [https://www.slicer.org/wiki/Documentation/Nightly/Developers/Plots](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Plots)
- [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Plotting](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Plotting)
