How to use fixed Xlim and YLim commands in processing?

I have created real-time plot with serial communication. I need a fixed vertical axis in my plot. I have used the grafica library to create the graphs. I have seen there is a command in Grafica library as “fixedYLim” and “fixedXLim” to fix the axes in the plot. I could not find a solution in library examples. Can anybody show me how to use fix limits commands??

1 Like

no Pictures to show?

use the library reference
…/Processing/libraries/grafica/reference/index.html?index-all.html
( or from PDE / Help / Libraries Reference / grafica / )

and the browser search [ctrl][f] like: XLim
and find

void 	setXLim(float[] newXLim)
Sets the horizontal axes limits
void 	setXLim(float lowerLim, float upperLim)
Sets the horizontal axes limits
void 	setFixedXLim(boolean newFixedXLim)
Sets if the horizontal axes limits are fixed or not
float[] 	getXLim()
Returns the limits of the horizontal axes
boolean 	getFixedXLim()
Returns true if the horizontal axes limits are fixed

also find in /grafica / examples / Moving Points /

  // Set the plot limits (this will fix them)
  plot.setXLim(-1.2*scale, 1.2*scale);
  plot.setYLim(-1.2*scale, 1.2*scale);

3 Likes