openturns icon indicating copy to clipboard operation
openturns copied to clipboard

It is uneasy to configure the bounds of a Graph

Open mbaudin47 opened this issue 4 years ago • 5 comments

In the following message:

https://stackoverflow.com/questions/63309636/how-to-set-axes-limits-on-openturns-viewer

the answers reveal that configuring the bounds of a graph is not easy. The set/getBoundingBox is not straightforward to use, because we must create an Interval first.

A more simple API would be based on setXMin, setXMax, setYmin, setYmax:

import openturns as ot
import openturns.viewer as otv
n = ot.Normal()
graph = n.drawPDF()
graph.setXMin(-1.0)
graph.setXMax(2.0)
graph.setYMin(-3.0)
graph.setYMax(1.0)

This API does not prevent from retaining the current boundingBox.

Another way to improve the situation would be to add this example to the following help page:

http://openturns.github.io/openturns/master/examples/graphs/graphs_basics.html

mbaudin47 avatar Sep 03 '20 09:09 mbaudin47