Hi,
I have a rather silly question. How do you adjust the y axis scale in the results window for the Relaxation Analysis? I have a bar plot where the longest relaxation time is 200 ms and yet the y axis goes all the way to 1 s. I tried to look around for an option, double clikcing, right clicking and just cannot figure out how to change the scale. A short Python command?
Thank you,
Józef
OK, an obvious workaround is to scale the axis using as usual scrolling. But it would be nice if I can just type a number for the limits I want.
Thanks,
J.
Hi Jozef,
Do you mean to set the zoom limits, like min-max in the current view or to constrain the possible view ranges (panning won’t go over the preset limits) ?
I can add an option on the right contex menu for the zoom limits, setting hard contraints is not ideal.
In anycase, can do both on command line
Which version are you using?
Hi Luca,
I mean min-max in the current view. I am using version 3.2.5.
Thanks,
Józef
ok a macro will be this:
module = getByGid('MO:Relaxation Analysis (Beta)')
mainPlotPanel = module.panelHandler.getPanel('MainPlotPanel')
plotWidget = mainPlotPanel.mainPlotWidget.plotWidget
plotWidget.setRange(yRange=[0,200])
the command to the plotWidget is setRange. It takes these arguments:
*xRange* (min,max) The range that should be visible along the x-axis.
*yRange* (min,max) The range that should be visible along the y-axis.
*padding* (float) Expand the view by a fraction of the requested range.
By default, this value is set between the default padding value
and 0.1 depending on the size of the ViewBox.
*update* (bool) If True, update the range of the ViewBox immediately.
Otherwise, the update is deferred until before the next render.
*disableAutoRange* (bool) If True, auto-ranging is diabled. Otherwise, it is left
unchanged.
Thank you. Exactly what I am looking for.
Józef