Fix scale of graph

Typically: "How do I... ", "How can I... " questions
Post Reply
MIFBob
Posts: 3
Joined: 23 Sep 2022, 10:48

Fix scale of graph

Post 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.

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Fix scale of graph

Post 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

MIFBob
Posts: 3
Joined: 23 Sep 2022, 10:48

Re: Fix scale of graph

Post 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.

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Fix scale of graph

Post 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

MIFBob
Posts: 3
Joined: 23 Sep 2022, 10:48

Re: Fix scale of graph

Post by MIFBob »

Thank you I will look into that.

Post Reply