Graphics window configuration
Graphics window configuration is available through parameters stored in :name_canvas_cfg
shared variable (accessible to all objects), where name is corresponding to the name of the window. Parameters of the main graphics window
(Graphics) are available in :pool_cfg
variable. The configuration variables are dictionaries.
Change of values of parameters triggers refresh of the window content as well as update of values of correlated parameters, e.g.:
"p := newp "Sin [
"data := genarray 360 [
let "x :index / (2*m_pi)
array :index (radsin :x) / :x
]
]
print :sin_canvas_cfg
:sin_canvas_cfg,"min_x := 0
:sin_canvas_cfg,"max_x := 360
:sin_canvas_cfg,"min_y := -0.4
:sin_canvas_cfg,"max_y := 1.1
print :sin_canvas_cfg
Parameters:
min_x, max_x: X axis range, correlated with values of scale_x and center_x;
min_y, max_y: Y axis range, correlated with values of scale_y and center_y;
scale_x: scale of drawing in X direction with respect to the pixel size, correlated with values of min_x and max_x;
scale_y: scale of drawing in Y direction with respect to the pixel size, correlated with values of min_y and max_y;
center_x: center of the window in X direction, correlated with values of min_x and max_x;
center_y: center of the window in Y direction, correlated with values of min_y i max_y;
antialiasing: boolean vlue, determines if lines and edges are rendered smooth (true
) or crisp
(false
);
refresh: boolean value, determines if the window content is automatically redrawn after instructions affecting look or position of objects;
note: change of :data
values does not cause refreshing, any change of window parameters causes
refreshing;
See also:
Turtle - plot - object
newp, newplot - create plot (synchronous constructor)
anewp, anewplot - create plot (asynchronous constructor)
Table of Content