BarGraph

Parent Previous Next

Full Library / Result / Plotter / BarGraph
Block Name: BarGraph

Code File Location: VisualSim/actor/lib/gui/BarGraph
public class BarGraph
extends ArrayPlotter

Description

This block plots the incoming data on the Y-Axis against the current simulation time on the X-axis. Every wire connected to this block input is considered a separate dataset and plotted separately. The block can display the plot during the simulation and/or save to file. The file name to save is entered in the block parameters.  The order of each dataset is the wire number that can be viewed by a mouse-over on the respective wire.

The block behavior is controlled as follows:

A bar graph plotter. The plotter accepts data on the input and plots them.  Multiple datasets can be created in associating each stream as an instance/channel.  To create a independent channel/instance, each incoming data wire can be attached to a relation or the DS_to_Instance block can be placed prior to this block with all the data wires connected to it.  Data at the input, which can consist of any number of channels, are plotted on this instance. Each input channel is plotted as a separate data set. Each input token is an array of doubles.

The Legend parameter can accept a comma separated list of elements to identify each dataset.  The order of this list and the order of connection of the datasets is key to make the match.

The iterationsPerUpdate parameter can be used to fine tune the display. It can be quite expensive to generate the display, and by default, this actor generates it on every firing. If iterationsPerUpdate is set to some integer greater than one, then it specifies how many iterations should be executed between updates. Thus, if iterationsPerUpdate = 2, then every second time this actor fires, it will update the display. That is, it will update its display on the first firing, the third, the fifth, etc. It will, however, consume its inputs on every firing. The plot is always updated in the wrapup() method.                                                                                                        Also save the model before checking the savePlot checkbox to ensure no error messages.

To understand the usage of the plotter, view the BarGraph Example in the BDE.


Parameter

Explanation

Type

Example

fillOnWrapup  This(Checkbox) determines whether to fill the plot when wrapup is invoked. - -
legend The legend is a comma-separated list of labels to attach to each dataset. The number of elements in this list should equal the number of input channels, although this is not enforced. String Read,Write
startingDataSet The index number of the first dataset to start the display. All datasets with number prior to this are not displayed. Integer 0
viewPlot If this option is enabled, the plot will be displayed during the simulation.  This must be disabled during batch mode. - -
savePlot If this option is enabled, then the plot will be saved to the File_Name. - -
fileName This block accepts a file name as a parameter. There are a number of file path options available for this block.  To see the list, view the section on File Paths in Reference Guide document here. The file name is a concatenation of any number of individual strings and parameters, separated by "+".  - -
iterationsPerUpdate The number of iterations between updates of the display on the screen. Its value must be non-negative. Integer
1
xUnit The increment of the X axis. Double
1.0
xInit The start point of the X axis. Double
0.0

Port

Explanation

Type

input This port can accept multiple dataset ( array of doubles ). Each dataset is associated with a unique color. The plot can accomodate up to 36 colors. Double

Created with the Personal Edition of HelpNDoc: Full-featured Help generator