Page 1 of 1

Fix scale of graph

Posted: 15 Nov 2022, 17:53
by MIFBob
How can you fix the scale of a graph?

I want to plot joint values and see quickly how close they are to joint limits - say as a % for instance

I saw a post from 2014 saying that it should be possible to do fix the graph scale in subsequent releases but I cannot seem to find how to do this.

I can plot the data ok but the scale also dynamically changes based upon the value of the data values, hence me wanting to fix the axes scale.

I am using CoppeliaSim Edu version 4.4.0

Any help gratefully appreciated. - Thanks.

Re: Fix scale of graph

Posted: 16 Nov 2022, 14:53
by coppelia
Hello,

when plotting data in a graph, you are fully in charge what point you want to display. You basically add new points via sim.setGraphStreamValue. If you select an X/Y graph to plot your data, then you can provide the X and Y values for a point, and discard points that are of no interest. Kind of filtering your values. By doing so, you should be able to have a better view onto data that is of interest for you.

Cheers

Re: Fix scale of graph

Posted: 17 Nov 2022, 10:15
by MIFBob
Thank you but what I was after was a Fixed Y Scale, nothing to do with the points that are plotted on this scale.

When I plot points; say y=1 and y=10 with x being the time, then the graph currently auto scales the y axis when the y=10 is plotted.

This is the functionality I wish to turn off.

What I want here is to always plot a y scale of say max 15, min -5.

Thanks.

Re: Fix scale of graph

Posted: 18 Nov 2022, 09:43
by coppelia
Ok, then you will have to handle the graph yourself, by creating a custom graph. Have a look at the example in scenes/customUI.ttt: in the dialog that pops open when simulation starts there is a Plot tab. See the related code around line 260 in the child script attached the object Script

Cheers

Re: Fix scale of graph

Posted: 18 Nov 2022, 10:31
by MIFBob
Thank you I will look into that.