Std New Graph: Difference between revisions

From LabRPS Documentation
Jump to navigation Jump to search
(Created page with "{{Docnav |Std New Matrix |Std New 2D Plot |Std File Menu |IconL=Std_New_Matrix.svg |IconR=Std_New_2DPlot.svg |IconC=Labrps.svg }} {{GuiCommand |Name=Std New Graph |MenuLocation=File → New Graph |Phenomena=All |Shortcut={{KEY|Ctrl}}+{{KEY|G}} |Version=0.1 |SeeAlso=Std New Matrix, Std New 2D Plot }} ==Description== The '''Std File New Graph''' command creates new table. ==U...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 19: Line 19:
==Description==
==Description==


The '''Std File New Graph''' command creates new table.  
The '''Std File New Graph''' command creates new graph.  


==Usage==
==Usage==
Line 28: Line 28:


==Note==
==Note==
It creates a new (empty) graph.
It creates a new (empty) graph. A 2D graph window displays the plot(s) and interacts with the user. The window has a canvas at its heart which is basically a background on which everything is drawn. one can add layout elements to the blank canvas which is the basic unit of a graph. A canvas can have an arbitrary number of child layout elements arranged in a grid fashion. The grid contains rows and columns to which layout elements can be added. Please see examples of 2D graph [[Meteorites_Data|here]] and [[Sine_Curve|here]].
 
=Window=
 
Graph2D windows typically shows layout order on top left side, layout management buttons on top right side and the plot in the center of the window
 
[[File:Graph2d_multilayout.png|center]]
 
A Graph2D window item contains the following mutable properties:
 
{| class="wikitable" style="float:left;clear:left;width:100%"
!colspan="2"|Graph2D Properties
|-
|<pre style="color: green;margin:5px;padding:5px">Name</pre>
|Sets a name for the window which is unique consisting of alphabets and numbers. No two window can have same name or symbols in their name(s).
|-
|<pre style="color: green;margin:5px;padding:5px">Label</pre>
|Sets the descriptive text for the window contents.
|-
|<pre style="color: green;margin:5px;padding:5px">Geometry</pre>
|This sets the geometry of the widow relative to its parent including any window frame.
''<strong>Note:</strong> for exporting the graph with a desired width and height, we recommend setting Plot Dimension property in Canvas section.''
|}
 
Graph2D windows are linked to their tanble/matrix data source(s). Removal of data sources automatically reflect the contents.
 
=Canvas=
The canvas is the area in which everything is drawn.
 
{| class="wikitable" style="float:left;clear:left;background-color:#ffffcc;width:100%"
!colspan="2"|Canvas Properties
|-
|<pre style="color: green;background-color:#ffffcc;margin:5px;padding:5px">Plot Dimension</pre>
|The plot dimension is the area in which the plot is drawn. All mechanisms, e.g. margin calculation take the dimension to be the outer border of the plot. The dimention normally is the rect width and height of the canvas, i.e. a rect with top left (0, 0) and size of the canvas.
|-
|<pre style="color: green;background-color:#ffffcc;margin:5px;padding:5px">Background Color</pre>
|Before drawing everything else, the background is filled with the selected color brush. For graphs with transparent background, set the color alpha level to 0;
|-
|<pre style="color: green;background-color:#ffffcc;margin:5px;padding:5px">Divice Pixel Ratio</pre>
|Sets the device pixel ratio used by the paint buffers of this Graph2D instance.
Normally, this doesn't need to be set manually, because it is initialized with the regular PixelRatio which is configured by Qt to fit the display device (e.g. 1 for normal displays, 2 for High-DPI displays).
|-
|<pre style="color: green;background-color:#ffffcc;margin:5px;padding:5px">OpenGL</pre>
|This method allows to enable OpenGL plot rendering, for increased plotting performance of graphically demanding plots (thick lines, translucent fills, etc.). If enabled is set to true, LabRPS will try to initialize OpenGL and, if successful, continue plotting with hardware acceleration. If the OpenGL initialization fails, rendering continues with the regular software rasterizer.
''<strong>Warning</strong>:
This is still an experimental feature and its performance depends on the system that it runs on. Having multiple LabRPS Graph2D items in one application with enabled OpenGL rendering might cause context conflicts on some systems.''
|-
|<pre style="color: green;background-color:#ffffcc;margin:5px;padding:5px">Row Spacing</pre>
|Sets the gap that is left blank between layout elements arranged in rows.
|-
|<pre style="color: green;background-color:#ffffcc;margin:5px;padding:5px">Column Spacing</pre>
|Sets the gap that is left blank between layout elements arranged in columns.
|}
 
canvas represents the lowest layer of all LabRPS graphs.
 
=Layout=
An layout element is typically an area enclosed on all sides with an arbitrary number of axes, where the graphs/potables are drawn in. It defines the rectangular bounding of child elements like Axes, plot(s), Legend(s), item()s etc (equivalent to a layer in SciDavis, QtiPlot, or Origin). Layout elements don't draw anything themselves but act as a container holding child elements. By default, Layout elements come with two axes, at the bottom and left.
 
[[File:Layout_element.png|center]]
 
The number of buttons on the left top side represents the number of layout elements in the plot window (1,1 and 1,2). Each element is represented as a row,column fashion inside the buttons. The active layout is marked by the red highlight around the layout button and the red triangle at the top right corner of the active layout element. Active layout elements can be changed either by clicking the layout element or by clicking the layout element button or by clicking the respective layout element in the property browser windows object browser pane.
 
{| class="wikitable" style="float:left;clear:left;width:100%"
!colspan="2"|Layout Properties
|-
|<pre style="color: green;margin:5px;padding:5px">Background Color</pre>
|Sets a name for the window which is unique consisting of alphabets and numbers. No two window can have same name or symbols in their name(s).
|-
|<pre style="color: green;margin:5px;padding:5px">Fill Style</pre>
|Sets the descriptive text for the window contents.
|-
|<pre style="color: green;margin:5px;padding:5px">Row Stretch Factor</pre>
|This sets the geometry of the widow relative to its parent including any window frame.
|-
|<pre style="color: green;margin:5px;padding:5px">Column Stretch Factor</pre>
|This sets the geometry of the widow relative to its parent including any window frame.
|-
|<pre style="color: green;margin:5px;padding:5px">Outer Rect</pre>
|This sets the geometry of the widow relative to its parent including any window frame.
|-
|<pre style="color: green;margin:5px;padding:5px">Margin</pre>
|This sets the geometry of the widow relative to its parent including any window frame.
|}
 
[[File:Layout_element_addremoverefreshbutton.png|center]]
 
Add layout button will add a layout next to the currently active layout. Remove Layout button will remove the active layout including all its child elements. Currently, Labrps only supports adding of elements as a linear horizontal vector (betterLayout management system under development).
 
==Layout Management==
adding or removing Layouts
 
=Layer=
 
The Layering system of LabRPS is the mechanism to control the rendering order of the elements inside the plot. When rendering, LabRPS goes through the list of layers bottom to top and successively draws the layerables of the layers into the paint buffer(s).
 
[[File:Graph2d_layer.png|center]]
 
Some of the layer orders are fixed for eg. canvas is the bottom most layer, followed by axis grid. Then you have all the layers associated with plottables and other items which can be custom organised followed by axis layer and Legend Layer.


{{Docnav
{{Docnav

Latest revision as of 20:02, 25 October 2024

Std New Graph.svg Std New Graph

Menu location
File → New Graph
Phenomena
All
Default shortcut
Ctrl+G
Introduced in version
0.1
See also
Std New Matrix, Std New 2D Plot

Description

The Std File New Graph command creates new graph.

Usage

  1. There are several ways to invoke the command:
    • Press the Std New Graph.svg New Graph button.
    • Select the File → Std New Graph.svgNew Graph option from the menu.
    • Use the keyboard shortcut: Ctrl+G.

Note

It creates a new (empty) graph. A 2D graph window displays the plot(s) and interacts with the user. The window has a canvas at its heart which is basically a background on which everything is drawn. one can add layout elements to the blank canvas which is the basic unit of a graph. A canvas can have an arbitrary number of child layout elements arranged in a grid fashion. The grid contains rows and columns to which layout elements can be added. Please see examples of 2D graph here and here.

Window

Graph2D windows typically shows layout order on top left side, layout management buttons on top right side and the plot in the center of the window

Graph2d multilayout.png

A Graph2D window item contains the following mutable properties:

Graph2D Properties
Name
Sets a name for the window which is unique consisting of alphabets and numbers. No two window can have same name or symbols in their name(s).
Label
Sets the descriptive text for the window contents.
Geometry
This sets the geometry of the widow relative to its parent including any window frame.

Note: for exporting the graph with a desired width and height, we recommend setting Plot Dimension property in Canvas section.

Graph2D windows are linked to their tanble/matrix data source(s). Removal of data sources automatically reflect the contents.

Canvas

The canvas is the area in which everything is drawn.

Canvas Properties
Plot Dimension
The plot dimension is the area in which the plot is drawn. All mechanisms, e.g. margin calculation take the dimension to be the outer border of the plot. The dimention normally is the rect width and height of the canvas, i.e. a rect with top left (0, 0) and size of the canvas.
Background Color
Before drawing everything else, the background is filled with the selected color brush. For graphs with transparent background, set the color alpha level to 0;
Divice Pixel Ratio
Sets the device pixel ratio used by the paint buffers of this Graph2D instance.

Normally, this doesn't need to be set manually, because it is initialized with the regular PixelRatio which is configured by Qt to fit the display device (e.g. 1 for normal displays, 2 for High-DPI displays).

OpenGL
This method allows to enable OpenGL plot rendering, for increased plotting performance of graphically demanding plots (thick lines, translucent fills, etc.). If enabled is set to true, LabRPS will try to initialize OpenGL and, if successful, continue plotting with hardware acceleration. If the OpenGL initialization fails, rendering continues with the regular software rasterizer.

Warning: This is still an experimental feature and its performance depends on the system that it runs on. Having multiple LabRPS Graph2D items in one application with enabled OpenGL rendering might cause context conflicts on some systems.

Row Spacing
Sets the gap that is left blank between layout elements arranged in rows.
Column Spacing
Sets the gap that is left blank between layout elements arranged in columns.

canvas represents the lowest layer of all LabRPS graphs.

Layout

An layout element is typically an area enclosed on all sides with an arbitrary number of axes, where the graphs/potables are drawn in. It defines the rectangular bounding of child elements like Axes, plot(s), Legend(s), item()s etc (equivalent to a layer in SciDavis, QtiPlot, or Origin). Layout elements don't draw anything themselves but act as a container holding child elements. By default, Layout elements come with two axes, at the bottom and left.

Layout element.png

The number of buttons on the left top side represents the number of layout elements in the plot window (1,1 and 1,2). Each element is represented as a row,column fashion inside the buttons. The active layout is marked by the red highlight around the layout button and the red triangle at the top right corner of the active layout element. Active layout elements can be changed either by clicking the layout element or by clicking the layout element button or by clicking the respective layout element in the property browser windows object browser pane.

Layout Properties
Background Color
Sets a name for the window which is unique consisting of alphabets and numbers. No two window can have same name or symbols in their name(s).
Fill Style
Sets the descriptive text for the window contents.
Row Stretch Factor
This sets the geometry of the widow relative to its parent including any window frame.
Column Stretch Factor
This sets the geometry of the widow relative to its parent including any window frame.
Outer Rect
This sets the geometry of the widow relative to its parent including any window frame.
Margin
This sets the geometry of the widow relative to its parent including any window frame.
Layout element addremoverefreshbutton.png

Add layout button will add a layout next to the currently active layout. Remove Layout button will remove the active layout including all its child elements. Currently, Labrps only supports adding of elements as a linear horizontal vector (betterLayout management system under development).

Layout Management

adding or removing Layouts

Layer

The Layering system of LabRPS is the mechanism to control the rendering order of the elements inside the plot. When rendering, LabRPS goes through the list of layers bottom to top and successively draws the layerables of the layers into the paint buffer(s).

Graph2d layer.png

Some of the layer orders are fixed for eg. canvas is the bottom most layer, followed by axis grid. Then you have all the layers associated with plottables and other items which can be custom organised followed by axis layer and Legend Layer.