The Graphics class provides a single interface to 2D (motif) and 3D (PLPLOT) graphics as well as tabular cataloguing of data for post-processing with Matlab, Tecplot, etc. More...
Public Member Functions | |
Graphics () | |
constructor | |
~Graphics () | |
destructor | |
void | create_plots_2d (const Variables &vars, const Response &response) |
creates the 2d graphics window and initializes the plots | |
void | create_tabular_datastream (const Variables &vars, const Response &response, const String &tabular_data_file) |
opens the tabular data file stream and prints the headings | |
void | add_datapoint (const Variables &vars, const Response &response) |
adds data to each window in the 2d graphics and adds a row to the tabular data file based on the results of a model evaluation | |
void | add_datapoint (int i, double x, double y) |
adds data to a single window in the 2d graphics | |
void | new_dataset (int i) |
creates a separate line graphic for subsequent data points for a single window in the 2d graphics | |
void | close () |
close graphics windows and tabular datastream | |
void | set_x_labels2d (const char *x_label) |
set x label for each plot equal to x_label | |
void | set_y_labels2d (const char *y_label) |
set y label for each plot equal to y_label | |
void | set_x_label2d (int i, const char *x_label) |
set x label for ith plot equal to x_label | |
void | set_y_label2d (int i, const char *y_label) |
set y label for ith plot equal to y_label | |
void | graphics_counter (int cntr) |
set graphicsCntr equal to cntr | |
int | graphics_counter () const |
return graphicsCntr | |
void | tabular_counter_label (const String &label) |
set tabularCntrLabel equal to label | |
Private Attributes | |
Graphics2D * | graphics2D |
pointer to the 2D graphics object | |
bool | win2dOn |
flag to indicate if 2D graphics window is active | |
bool | tabularDataFlag |
flag to indicate if tabular data stream is active | |
int | graphicsCntr |
used for x axis values in 2D graphics and for 1st column in tabular data | |
String | tabularCntrLabel |
label for counter used in first line comment w/i the tabular data file | |
std::ofstream | tabularDataFStream |
file stream for tabulation of graphics data within compute_response |
The Graphics class provides a single interface to 2D (motif) and 3D (PLPLOT) graphics as well as tabular cataloguing of data for post-processing with Matlab, Tecplot, etc.
There is only one Graphics object (dakotaGraphics) and it is global (for convenient access from strategies, models, and approximations).
creates the 2d graphics window and initializes the plots
Sets up a single event loop for duration of the dakotaGraphics object, continuously adding data to a single window. There is no reset. To start over with a new data set, you need a new object (delete old and instantiate new).
References Variables::continuous_variable_labels(), Variables::cv(), String::data(), Variables::discrete_int_variable_labels(), Variables::discrete_real_variable_labels(), Variables::div(), Variables::drv(), Response::function_labels(), Graphics::graphics2D, CtelRegexp::match(), Response::num_functions(), and Graphics::win2dOn.
Referenced by SurrBasedMinimizer::initialize_graphics(), NonDReliability::initialize_graphics(), and Iterator::initialize_graphics().
void create_tabular_datastream | ( | const Variables & | vars, |
const Response & | response, | ||
const String & | tabular_data_file | ||
) |
opens the tabular data file stream and prints the headings
Opens the tabular data file stream and prints headings, one for each continuous and discrete variable and one for each response function, using the variable and response function labels. This tabular data is used for post-processing of DAKOTA results in Matlab, Tecplot, etc.
References Variables::continuous_variable_labels(), Variables::cv(), Variables::discrete_int_variable_labels(), Variables::discrete_real_variable_labels(), Variables::div(), Variables::drv(), Response::function_labels(), Response::num_functions(), Graphics::tabularCntrLabel, Graphics::tabularDataFlag, and Graphics::tabularDataFStream.
Referenced by SurrBasedMinimizer::initialize_graphics(), and Iterator::initialize_graphics().
adds data to each window in the 2d graphics and adds a row to the tabular data file based on the results of a model evaluation
Adds data to each 2d plot and each tabular data column (one for each active variable and for each response function). graphicsCntr is used for the x axis in the graphics and the first column in the tabular data.
References Response::active_set_request_vector(), Variables::continuous_variables(), Variables::discrete_int_variables(), Variables::discrete_real_variables(), Response::function_values(), Graphics::graphics2D, Graphics::graphicsCntr, Graphics::tabularDataFlag, Graphics::tabularDataFStream, Graphics::win2dOn, Dakota::write_data_tabular(), and Response::write_tabular().
Referenced by Model::compute_response(), NonDLocalReliability::mean_value(), SurrBasedLocalMinimizer::minimize_surrogates(), Model::synchronize(), Model::synchronize_nowait(), and NonDLocalReliability::update_level_data().
void add_datapoint | ( | int | i, |
double | x, | ||
double | y | ||
) |
adds data to a single window in the 2d graphics
Adds data to a single 2d plot. Allows complete flexibility in defining other kinds of x-y plotting in the 2D graphics.
References Graphics::graphics2D, and Graphics::win2dOn.
void new_dataset | ( | int | i | ) |
creates a separate line graphic for subsequent data points for a single window in the 2d graphics
Used for displaying multiple data sets within the same plot.
References Graphics::graphics2D, and Graphics::win2dOn.
Referenced by NonDLocalReliability::update_level_data().