45 const double x_offset=0.0,
46 const double y_scaling=1.0,
47 const double y_offset=0.0,
53 const double width = 1.0,
59 const double width = 1.0,
67 const double fontSize = 12.0,
68 const string &font =
"Times-Roman");
72 const double fontSize = 12.0,
73 const string &font =
"Times-Roman");
89 if ( self_owned_lines )
104 const double x_offset,
105 const double y_scaling,
106 const double y_offset,
112 cout <<
"Please set the axes first" << endl;
146 const double fontSize,
152 cout <<
"SetXAxis first, please." << endl;
158 cout <<
"due to stupidity, please CreateTics(...) first" << endl;
167 double label_x_pos = axis_start.first + (double) (axis_stop.first-axis_start.first)/2 - (double) label.size()/2;
168 double label_y_pos = axis_start.second - 2.0*
m_ticking->
GetSize() - 2.0*fontSize;
170 xy_coords label_coords = make_pair(label_x_pos,label_y_pos);
184 const double fontSize,
190 cout <<
"SetYAxis first, please." << endl;
196 cout <<
"due to stupidity, please CreateTics(...) first" << endl;
205 double label_x_pos = axis_start.first - 1.0*
m_ticking->
GetSize() - 2.0*fontSize;
206 double label_y_pos = axis_start.second
207 + (double) (axis_stop.second - axis_start.second)/2 - (double) label.size()/2;
209 xy_coords label_coords = make_pair(label_x_pos,label_y_pos);
252 cout <<
"bad form" << endl;
262 if ( xtics.size() != xticlabs.size() )
264 cout <<
"xtic irregularity" << endl;
267 if ( ytics.size() != yticlabs.size() )
269 cout <<
"ytic irregularity" << endl;
280 for (
int i=0; i<(int) xtics.size(); ++i )
286 for (
int i=0; i<(int) ytics.size(); ++i )
Definition: Whiteboard.h:276
double GetSize()
Definition: TicMarks.h:37
text * m_yLabel
Definition: Axes.h:80
virtual ~axes()
Definition: Axes.h:87
line * m_xLine
Definition: Axes.h:78
void Draw(display_type *d)
Definition: Whiteboard.h:433
Definition: Whiteboard.h:394
vector< text > GetYText()
Definition: TicMarks.h:42
void SetYAxis(const xy_coords &startCoords, const xy_coords &stopCoords, const double width=1.0, const color &c=black)
Definition: Axes.h:233
TickingStrategyBase * m_ticking
Definition: Axes.h:82
The whiteboard namespace.
Definition: Axes.h:10
void SetXAxisLabel(const string &label, const color &c=black, const double fontSize=12.0, const string &font="Times-Roman")
Definition: Axes.h:144
vector< line > GetXLines()
Definition: TicMarks.h:39
void Draw(display_type *d)
Definition: Whiteboard.h:292
double GetWidth() const
Definition: Whiteboard.h:302
vector< line > GetYLines()
Definition: TicMarks.h:40
Definition: TicMarks.h:56
const color black(0, 0, 0)
axes(line *x_line, line *y_line)
Definition: Axes.h:30
Definition: Whiteboard.h:136
void Draw(display_type *d)
Definition: Axes.h:247
Definition: TicMarks.h:13
tic_style
Definition: TicMarks.h:13
Definition: TicMarks.h:13
void SetXAxis(const xy_coords &startCoords, const xy_coords &stopCoords, const double width=1.0, const color &c=black)
Definition: Axes.h:221
pair< double, double > xy_coords
Definition: Whiteboard.h:30
vector< text > GetXText()
Definition: TicMarks.h:41
virtual void CreateTicking()=0
bool self_owned_lines
Definition: Axes.h:84
Definition: Whiteboard.h:46
axes()
Definition: Axes.h:22
Definition: TicMarks.h:13
File holding the base drawing classes of the whiteboard.
text * m_xLabel
Definition: Axes.h:80
Definition: TicMarks.h:13
Definition: TicMarks.h:15
xy_coords StartCoords() const
Definition: Whiteboard.h:300
line * m_yLine
Definition: Axes.h:78
void SetYAxisLabel(const string &label, const color &c=black, const double fontSize=12.0, const string &font="Times-Roman")
Definition: Axes.h:182
void RescaleAxes()
Definition: Axes.h:63
void CreateTics(const double x_scaling=1.0, const double x_offset=0.0, const double y_scaling=1.0, const double y_offset=0.0, const tic_style t=linear)
Definition: Axes.h:103
xy_coords StopCoords() const
Definition: Whiteboard.h:301