Graphics in RBASIC™
Creating a graphics output is particularly simple with RBASIC. Opening and closing graph windows and plotting spectrum graphs can be accomplished with very little programming effort. OPENGRAPH Opens a graphics window with X,Y dimensions and names it. Example: OPENGRAPH("mygraph1",200,100) CLOSEGRAPH Closes a graphic window. Example: CLOSEGRAPH("mygraph1") CLEAR Clears the graphic window. Example: CLEAR("mygraph1") CLEARV Clears only one vertical line in a graph. Example: CLEARV("mygraph1",x_coordinate) This is useful for realtime plotting of spectra (clears the old spectrum). CLEARH Clears only one horizontal line in a graph. Example: CLEARH("mygraph1",y_coordinate) SETCOLOR Sets the current color (red, green, blue; with values ranging from 0 to 255) in the graph. This affects all drawing commands. Example: SETCOLOR("mygraph1",red,green,blue) SETPOINT Sets graph pixel [X,Y] to the current color. A synonym for SETPOINT is SETP. Example: SETPOINT("mygraph1",x,y) or SETP("mygraph1",x,y) PLOT Draws a line from last position to the new one. Example: PLOT("mygraph1",new_x,new_y) LINE Draws a line defined by the start and end coordinates. Example: LINE("mygraph1",x1,y1,x2,y2) In addition to the above graphics commands, there is a single graphic function POINT, which returns the color of a point if it is set, and zero if it is reset. The color value is calculated as RED+256*GREEN+65536*BLUE (corresponding to hexadecimal representation BBGGRR). Example: color=POINT("mygraph1",x,y)
