Display¶
Note
Colour attributes, in the current FEMAG versions, should be declared in strings , e.g. “red” instead of red.
Command: grf_clear()
Deletes the contents of the graphics window.
Command: adapt_windo()
Adjusts a section of the graphics window to it contents.
Command: draw_spels()
Draw the superelements.
Command: draw_ndchns()
Draw node chains.
Command: draw_elem(elkey, color, mode)
Draw an element in a specified colour
- Parameter
- elkey element numbercolor colour (“red”, “blue”, “green”)mode 0 : display without edges; 1 : display with edges
Example: Addressing by element number
draw_elem(elkey,"blue",0)
draw_elem(elkey,blue,0) -- deprecated version
Command: draw_elem(x, y, color, mode)
Draw an element in a specified colour
- Parameter
- x,y x,y coordinatescolor colour (“red”, “blue”, “green”)mode 0 : display without edges; 1 : display with edges
Example: Addressing by coordinates
draw_elem(x,y,"blue",0)
draw_elem(x,y,blue,0) -- deprecated version
Command: draw_mesh_edge()
Draw the mesh.
Command: plot_2d(x, y, pos)
Create a line plot in the graphics window based on the pair values x and y at the position pos
- Parameter
- x,y x,y coordinatespos position code
Example:
px, py = {}, {} -- generate example data
for i=1,400 do
px[i] = i
py[i] = math.sin(i/180*math.pi)
end
plot_2d(pxx,pyx,6) -- plot the diagramm
Further display adjustments can be made with arguments that are passed in a data structure like the following example shows.
Example: Expanded call with optional arguments (opt.).
plot_2d(x = px, -- x data array
y = py, -- y data array
pos = 7, -- placement code
xmin = 0, -- x range lower limit (opt.)
xmax = 400, -- upper limit (opt.)
ymin = 0, -- y range lower limit (opt.)
ymax = 1, -- upper limit (opt.)
xlabel = "xlabel", -- x axis label (opt.)
ylabel = "ylabel", -- y axis label (opt.)
ylabel2 = "ylabel2", -- sub label (opt.)
color = "blue") -- color code or description string (opt.)
See also applications examples Ausgabe von Diagrammen und Verwendung von poc-Files in individuellen Berechnungsabläufen.