Class to represent a 2D points plot. More...
#include "gnuplot.h"
Classes | |
struct | Data2d |
Structure storing the data to for a 2D plot. More... | |
struct | Point |
A point in a 2D plot. More... | |
Public Types | |
enum | ErrorBars { NONE , X , Y , XY } |
Whether errorbars should be used for this dataset. More... | |
enum | Style { LINES , POINTS , LINES_POINTS , DOTS , IMPULSES , STEPS , FSTEPS , HISTEPS } |
The plotting style to use for this dataset. More... | |
Public Member Functions | |
Gnuplot2dDataset (const std::string &title="Untitled") | |
void | Add (double x, double y) |
void | Add (double x, double y, double errorDelta) |
void | Add (double x, double y, double xErrorDelta, double yErrorDelta) |
void | AddEmptyLine () |
Add an empty line in the data output sequence. More... | |
void | SetErrorBars (ErrorBars errorBars) |
void | SetStyle (Style style) |
![]() | |
GnuplotDataset (const GnuplotDataset &original) | |
Reference-counting copy constructor. More... | |
~GnuplotDataset () | |
Reference-counting destructor. More... | |
GnuplotDataset & | operator= (const GnuplotDataset &original) |
Reference-counting assignment operator. More... | |
void | SetExtra (const std::string &extra) |
Add extra formatting parameters to this dataset. More... | |
void | SetTitle (const std::string &title) |
Change line title. More... | |
Static Public Member Functions | |
static void | SetDefaultErrorBars (ErrorBars errorBars) |
Change default errorbars style for all newly created objects. More... | |
static void | SetDefaultStyle (Style style) |
Change default style for all newly created objects. More... | |
![]() | |
static void | SetDefaultExtra (const std::string &extra) |
Change extra formatting style parameters for newly created objects. More... | |
Private Types | |
typedef std::vector< struct Point > | PointSet |
The set of points in the dataset. More... | |
Static Private Attributes | |
static ErrorBars | m_defaultErrorBars |
default error bars type More... | |
static Style | m_defaultStyle |
default plot style More... | |
Additional Inherited Members | |
![]() | |
GnuplotDataset (struct Data *data) | |
Called by constructors of derived classes. More... | |
![]() | |
struct Data * | m_data |
Reference counted data object. More... | |
![]() | |
static std::string | m_defaultExtra = "" |
Extra gnuplot parameters set on every newly created dataset. More... | |
Class to represent a 2D points plot.
Set the line or points style using SetStyle() and set points using Add().
|
private |
ns3::Gnuplot2dDataset::Gnuplot2dDataset | ( | const std::string & | title = "Untitled" | ) |
title | the title to be associated to this dataset (default "Untitled"). |
Create an empty dataset. Usually, the dataset's title is displayed in the legend box.
Definition at line 347 of file gnuplot.cc.
void ns3::Gnuplot2dDataset::Add | ( | double | x, |
double | y | ||
) |
x | x coord to new data point |
y | y coord to new data point |
Use this method with error bar style NONE.
Definition at line 377 of file gnuplot.cc.
References data, ns3::GnuplotDataset::m_data, NONE, NS_ASSERT, and two-ray-to-three-gpp-ch-calibration::x.
Referenced by Experiment::AdvancePosition(), ChangeSignalAndReportRate(), Experiment::CheckThroughput(), anonymous_namespace{gnuplot-example.cc}::Create2DPlotFile(), anonymous_namespace{gnuplot-example.cc}::Create2DPlotWithErrorBarsFile(), Experiment::IncrementCw(), TestDeterministic(), and TestDeterministicByTime().
void ns3::Gnuplot2dDataset::Add | ( | double | x, |
double | y, | ||
double | errorDelta | ||
) |
x | x coord to new data point |
y | y coord to new data point |
errorDelta | x and y data point uncertainty |
Use this method with error bar style X or Y.
Definition at line 391 of file gnuplot.cc.
References data, ns3::GnuplotDataset::m_data, NS_ASSERT, two-ray-to-three-gpp-ch-calibration::x, X, and Y.
void ns3::Gnuplot2dDataset::Add | ( | double | x, |
double | y, | ||
double | xErrorDelta, | ||
double | yErrorDelta | ||
) |
x | x coord to new data point |
y | y coord to new data point |
xErrorDelta | x data point uncertainty |
yErrorDelta | y data point uncertainty |
Use this method with error bar style XY.
Definition at line 406 of file gnuplot.cc.
References data, ns3::GnuplotDataset::m_data, NS_ASSERT, two-ray-to-three-gpp-ch-calibration::x, and XY.
void ns3::Gnuplot2dDataset::AddEmptyLine | ( | ) |
Add an empty line in the data output sequence.
Empty lines in the plot data break continuous lines and do other things in the output.
Definition at line 420 of file gnuplot.cc.
References data, and ns3::GnuplotDataset::m_data.
|
static |
Change default errorbars style for all newly created objects.
errorBars | the style of errorbars to use for newly created datasets. |
Definition at line 365 of file gnuplot.cc.
References m_defaultErrorBars.
Referenced by ns3::GnuplotAggregator::Set2dDatasetDefaultErrorBars().
|
static |
Change default style for all newly created objects.
style | the style of plotting to use for newly created datasets. |
Definition at line 353 of file gnuplot.cc.
References m_defaultStyle.
Referenced by ns3::GnuplotAggregator::Set2dDatasetDefaultStyle().
void ns3::Gnuplot2dDataset::SetErrorBars | ( | ErrorBars | errorBars | ) |
errorBars | the style of errorbars to display. |
If you use any style other than none, you need to make sure you store the delta information in this dataset with the right GnuplotDataset::Add method.
Definition at line 371 of file gnuplot.cc.
References ns3::GnuplotDataset::m_data.
Referenced by anonymous_namespace{gnuplot-example.cc}::Create2DPlotWithErrorBarsFile().
void ns3::Gnuplot2dDataset::SetStyle | ( | Style | style | ) |
style | the style of plotting to use for this dataset. |
Definition at line 359 of file gnuplot.cc.
References ns3::GnuplotDataset::m_data.
Referenced by Experiment::Experiment(), anonymous_namespace{gnuplot-example.cc}::Create2DPlotFile(), anonymous_namespace{gnuplot-example.cc}::Create2DPlotWithErrorBarsFile(), TestDeterministic(), and TestDeterministicByTime().
|
staticprivate |
default error bars type
Definition at line 229 of file gnuplot.h.
Referenced by SetDefaultErrorBars().
|
staticprivate |