Class to represent a 2D points plot. Set the line or points style using SetStyle() and set points using Add(). More...
#include <gnuplot.h>
Classes | |
struct | Data2d |
struct | Point |
Public Types | |
enum | ErrorBars { NONE, X, Y, XY } |
enum | Style { LINES, POINTS, LINES_POINTS, DOTS, IMPULSES, STEPS, FSTEPS, HISTEPS } |
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 () |
void | SetErrorBars (enum ErrorBars errorBars) |
void | SetStyle (enum Style style) |
![]() | |
GnuplotDataset (const GnuplotDataset &original) | |
~GnuplotDataset () | |
GnuplotDataset & | operator= (const GnuplotDataset &original) |
void | SetExtra (const std::string &extra) |
Add extra formatting parameters to this dataset. | |
void | SetTitle (const std::string &title) |
Change line title. |
Static Public Member Functions | |
static void | SetDefaultErrorBars (enum ErrorBars errorBars) |
static void | SetDefaultStyle (enum Style style) |
![]() | |
static void | SetDefaultExtra (const std::string &extra) |
Change extra formatting style parameters for newly created objects. |
Private Types | |
typedef std::vector< struct Point > | PointSet |
Static Private Attributes | |
static enum ErrorBars | m_defaultErrorBars |
static enum Style | m_defaultStyle |
Additional Inherited Members | |
![]() | |
GnuplotDataset (struct Data *data) | |
![]() | |
struct Data * | m_data |
![]() | |
static std::string | m_defaultExtra = "" |
Extra gnuplot parameters set on every newly created dataset. |
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. |
Create an empty dataset. Usually, the dataset's title is displayed in the legend box.
Definition at line 263 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 291 of file gnuplot.cc.
References ns3::Gnuplot2dDataset::Point::dx, ns3::Gnuplot2dDataset::Point::dy, ns3::Gnuplot2dDataset::Point::empty, ns3::GnuplotDataset::m_data, NONE, NS_ASSERT, sample-rng-plot::x, ns3::Gnuplot2dDataset::Point::x, and ns3::Gnuplot2dDataset::Point::y.
Referenced by anonymous_namespace{gnuplot-example.cc}::Create2DPlotFile(), anonymous_namespace{gnuplot-example.cc}::Create2DPlotWithErrorBarsFile(), Histogramm(), Experiment::IncrementCw(), main(), 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 305 of file gnuplot.cc.
References ns3::Gnuplot2dDataset::Point::dx, ns3::Gnuplot2dDataset::Point::dy, ns3::Gnuplot2dDataset::Point::empty, ns3::GnuplotDataset::m_data, NS_ASSERT, sample-rng-plot::x, X, ns3::Gnuplot2dDataset::Point::x, Y, and ns3::Gnuplot2dDataset::Point::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 320 of file gnuplot.cc.
References ns3::Gnuplot2dDataset::Point::dx, ns3::Gnuplot2dDataset::Point::dy, ns3::Gnuplot2dDataset::Point::empty, ns3::GnuplotDataset::m_data, NS_ASSERT, sample-rng-plot::x, ns3::Gnuplot2dDataset::Point::x, XY, and ns3::Gnuplot2dDataset::Point::y.
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 334 of file gnuplot.cc.
References ns3::Gnuplot2dDataset::Point::empty, 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 280 of file gnuplot.cc.
References m_defaultErrorBars.
|
static |
Change default style for all newly created objects.
style | the style of plotting to use for newly created datasets. |
Definition at line 269 of file gnuplot.cc.
References m_defaultStyle.
void ns3::Gnuplot2dDataset::SetErrorBars | ( | enum 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 285 of file gnuplot.cc.
References ns3::GnuplotDataset::m_data.
Referenced by anonymous_namespace{gnuplot-example.cc}::Create2DPlotWithErrorBarsFile().
void ns3::Gnuplot2dDataset::SetStyle | ( | enum Style | style | ) |
style | the style of plotting to use for this dataset. |
Definition at line 274 of file gnuplot.cc.
References ns3::GnuplotDataset::m_data.
Referenced by anonymous_namespace{gnuplot-example.cc}::Create2DPlotFile(), anonymous_namespace{gnuplot-example.cc}::Create2DPlotWithErrorBarsFile(), Histogramm(), TestDeterministic(), and TestDeterministicByTime().
|
staticprivate |
Definition at line 215 of file gnuplot.h.
Referenced by SetDefaultErrorBars().
|
staticprivate |
Definition at line 214 of file gnuplot.h.
Referenced by SetDefaultStyle().