# Plotting help? SetXColumnName ignored

**URL:** https://discourse.slicer.org/t/plotting-help-setxcolumnname-ignored/15751
**Category:** Support
**Created:** [January 31, 2021, 4:36pm UTC](https://discourse.slicer.org/t/plotting-help-setxcolumnname-ignored/15751 "2021-01-31T16:36:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bloyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bloyl/32/9556_2.png) [@bloyl](https://discourse.slicer.org/u/bloyl)
#### Post date: [January 31, 2021, 4:36pm UTC](https://discourse.slicer.org/t/plotting-help-setxcolumnname-ignored/15751/1 "2021-01-31T16:36:08Z")

</div>

I am trying to work with slicer’s plotting nodes to use in an extension and I’m running into some issues

The main one is that calling `SetXColumnName('X')` on a `vtkMRMLPlotSeriesNode` seems to be ignored, and the x axis is always just the row index of the table.

here is the [script](https://gist.github.com/bloyl/c3bf0dd584ed675c3e1d3e6c2129e1be) i’ve been testing with.

I would have expected the x axis to run from 1000-1100 as opposed to 0-100. calling `SetYColumnName` auto updates the Y values so the table seems correct.

Can you also point me to the api that shows how to turn on/set the x and y axis labels?

Thanks!  
Luke

---

<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: [January 31, 2021, 8:50pm UTC](https://discourse.slicer.org/t/plotting-help-setxcolumnname-ignored/15751/2 "2021-01-31T20:50:43Z")

</div>

“X axis column” is only used by scatter plot types, such as “scatter” or “scatter bar”. If you just want to display labels for values in “Y axis column” then you can choose any string column as “Labels column”. To get familiar with how things work, you can get started with using Plots module GUI.

If you just need to plot a numpy array, you can use the [`slicer.util.plot`](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.plot) convenience function. For example:

```python
values = np.random.uniform(5, 25, [10,2])
chart = slicer.util.plot(values, xColumnIndex=0, columnNames=['x' ,'y'], title='My chart')

```

See more examples [here](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Slicer_plots_displayed_in_view_layout).
