VTKFIG  0.20.20181114
Easy VTK based in situ visualization
vtkfigXYPlot.cxx
Go to the documentation of this file.
1 #include <vtkProperty2D.h>
2 #include <vtkTextProperty.h>
3 #include <vtkAxisActor2D.h>
4 #include <vtkLegendBoxActor.h>
5 
6 #include "vtkfigXYPlot.h"
7 #include "config.h"
8 
9 namespace vtkfig
10 {
12  {
13  this->XYPlotActor=vtkSmartPointer<vtkXYPlotActor>::New();
14  this->LegendActor=vtkSmartPointer<vtkLegendBoxActor>::New();
15  this->LegendActor->SetNumberOfEntries(0);
16  }
17 
18 
19  std::shared_ptr<XYPlot> XYPlot::New()
20  {
21  return std::make_shared<XYPlot>();
22  }
23 
24 
25  std::string XYPlot::SubClassName()
26  {
27  return std::string("XYPlot");
28  }
29 
30 
32  {
33  XYPlotActor->RemoveAllActiveCurves();
34  num_plots=0;
35  NextPlotInfo.line_type[0]='-';
38  NextPlotInfo.legend[0]=0;
39 
43 
44  PlotState.dynXMin=1.0e100;
45  PlotState.dynXMax=-1.0e100;
46  PlotState.dynYMin=1.0e100;
47  PlotState.dynYMax=-1.0e100;
48  }
49 
50 
51  void XYPlot::SetTitle(const std::string t)
52  {
53  XYPlotActor->SetTitle(t.c_str());
54  title=t;
55  }
56 
57  void XYPlot::SetXTitle(const std::string t)
58  {
59  XYPlotActor->SetXTitle(t.c_str());
60  xtitle=t;
61  }
62 
63  void XYPlot::SetYTitle(const std::string t )
64  {
65  XYPlotActor->SetYTitle(t.c_str());
66  ytitle=t;
67  }
68 
69  void XYPlot::SetXRange(double x0, double x1)
70  {
71  PlotState.fixXMin=x0;
72  PlotState.fixXMax=x1;
73  }
74 
75 
76  void XYPlot::SetYRange(double y0, double y1)
77  {
78  PlotState.fixYMin=y0;
79  PlotState.fixYMax=y1;
80  }
81 
83  {
84  PlotState.nxlabels=n;
85  }
86 
88  {
89  PlotState.nylabels=n;
90  }
91 
92  void XYPlot::SetXAxisLabelFormat(const std::string fmt)
93  {
94  strncpy(PlotState.xlabel_format,fmt.c_str(),desclen);
95  }
96 
97 
98  void XYPlot::SetYAxisLabelFormat(const std::string fmt)
99  {
100  strncpy(PlotState.ylabel_format,fmt.c_str(),desclen);
101  }
102 
103  void XYPlot::AdjustLabels(bool b )
104  {
105  PlotState.adjust_labels=b;
106  };
107 
108 
109  void XYPlot::ShowGrid(bool b )
110  {
111  PlotState.grid_show=b;
112  };
113 
114  void XYPlot::SetGridColor(double r, double g, double b)
115  {
116  PlotState.grid_rgb[0]=r;
117  PlotState.grid_rgb[1]=g;
118  PlotState.grid_rgb[2]=b;
119  }
120 
121  void XYPlot::SetAxesColor(double r, double g, double b)
122  {
123  PlotState.axes_rgb[0]=r;
124  PlotState.axes_rgb[1]=g;
125  PlotState.axes_rgb[2]=b;
126  }
127 
128 
129  void XYPlot::ShowLegend(bool b )
130  {
131  PlotState.legend_show=b;
132  };
133 
134  void XYPlot::SetLegendPosition(double x, double y)
135  {
136  PlotState.legend_posx=x;
137  PlotState.legend_posy=y;
138  }
139 
140  void XYPlot::SetLegendSize(double w, double h)
141  {
142  PlotState.legend_w=w;
143  PlotState.legend_h=h;
144  }
145 
146 
147  void XYPlot::SetPlotLineType(const std::string type)
148  {
149  strncpy(NextPlotInfo.line_type,type.c_str(),desclen);
150  }
151 
152  void XYPlot::SetPlotLegend(const std::string legend)
153  {
154  strncpy(NextPlotInfo.legend,legend.c_str(),desclen);
155  }
156 
157  void XYPlot::SetPlotColor(double r, double g, double b)
158  {
159  NextPlotInfo.line_rgb[0]=r;
160  NextPlotInfo.line_rgb[1]=g;
161  NextPlotInfo.line_rgb[2]=b;
162  }
163 
164  void XYPlot::SetLineWidth(double w)
165  {
166  PlotState.line_width=w;
167  }
168 
169 
170  void XYPlot::SetMarkerSize(double s)
171  {
172  PlotState.marker_size=s;
173  }
174 
175  void XYPlot::SetPlotMarkerType(const std::string type)
176  {
177  strncpy(NextPlotInfo.marker_type,type.c_str(),desclen);
178  }
179 
180 
181 
182  void XYPlot::RTBuildAllVTKPipelines(vtkSmartPointer<vtkRenderer> renderer)
183  {
184 
185  XYPlotActor->GetProperty()->SetColor(PlotState.axes_rgb);
186  XYPlotActor->SetBorder(20);
187  XYPlotActor->GetPositionCoordinate()->SetValue(0.0, 0.0, 0);
188  XYPlotActor->GetPosition2Coordinate()->SetValue(1.0, 1.0, 0);
189 
190 
191  if (PlotState.adjust_labels)
192  {
193  XYPlotActor->SetAdjustXLabels(1);
194  XYPlotActor->SetAdjustYLabels(1);
195  }
196  else
197  {
198  XYPlotActor->SetAdjustXLabels(0);
199  XYPlotActor->SetAdjustYLabels(0);
200  }
201 
202  // We build our own legened box which is
203  // not cluttered with grid lines
204  // XYPlotActor->LegendOn();
205  // XYPlotActor->SetLegendBox(1);
206  // XYPlotActor->SetLegendBorder(1);
207 
208 
209  XYPlotActor->PlotPointsOff();
210  XYPlotActor->PlotLinesOn();
211  XYPlotActor->PlotCurvePointsOn();
212  XYPlotActor->PlotCurveLinesOn();
213 
214 
215 
216  XYPlotActor->SetNumberOfXLabels(PlotState.nxlabels);
217  XYPlotActor->SetNumberOfYLabels(PlotState.nylabels);
218  XYPlotActor->SetNumberOfXMinorTicks(10);
219  XYPlotActor->SetNumberOfYMinorTicks(10);
220 
221 
222 
223  int fs=30;
224  XYPlotActor->SetTitleFontSize(fs);
225  XYPlotActor->SetTitleShadow(0);
226  XYPlotActor->SetTitleItalic(0);
227  XYPlotActor->SetTitleBold(1);
228  XYPlotActor->SetTitleColor(0,0,0);
229 
230  XYPlotActor->SetAdjustTitlePosition(0);
231  XYPlotActor->SetTitlePosition(0.5,0.95);
232 
233 
234  XYPlotActor->SetAxisTitleFontSize(fs);
235  XYPlotActor->SetAxisTitleItalic(0);
236  XYPlotActor->SetAxisTitleShadow(0);
237  XYPlotActor->SetAxisTitleBold(1);
238  XYPlotActor->SetAxisTitleColor(0,0,0);
239 
240  XYPlotActor->SetAxisLabelFontSize(fs);
241  XYPlotActor->SetAxisLabelShadow(0);
242  XYPlotActor->SetAxisLabelItalic(0);
243  XYPlotActor->SetAxisLabelColor(0,0,0);
244  XYPlotActor->SetYTitlePositionToVCenter();
245 
246 
247 
248  XYPlotActor->SetXValuesToValue();
250 
251 
252  if (PlotState.legend_show)
253  {
254  this->LegendActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
255  this->LegendActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
256  this->LegendActor->GetPosition2Coordinate()->SetReferenceCoordinate( NULL );
257 
258 
259  this->LegendActor->SetPosition(PlotState.legend_posx,PlotState.legend_posy);
260  this->LegendActor->SetPosition2(
261  PlotState.legend_posx+PlotState.legend_w,
262  PlotState.legend_posy+PlotState.legend_h);
263  this->LegendActor->SetBorder(true);
264  this->LegendActor->SetBox(true);
265  LegendActor->GetProperty()->DeepCopy(XYPlotActor->GetProperty());
266  LegendActor->ScalarVisibilityOff();
267  auto text_prop = LegendActor->GetEntryTextProperty();
268  text_prop->ItalicOff();
269  text_prop->SetFontFamilyToArial();
270  text_prop->SetFontSize(fs);
271 
272 
274  }
275 
276  }
277 
278 
279 
280 
281  void XYPlot::GridLine::SetYLine(double xrange[2], double y)
282  {
283  X->InsertTuple1(0,xrange[0]);
284  Y->InsertTuple1(0,y);
285 
286  X->InsertTuple1(1,xrange[1]);
287  Y->InsertTuple1(1,y);
288  }
289  void XYPlot::GridLine::SetXLine(double yrange[2], double x)
290  {
291  X->InsertTuple1(0,x);
292  Y->InsertTuple1(0,yrange[0]);
293 
294  X->InsertTuple1(1,x);
295  Y->InsertTuple1(1,yrange[1]);
296  }
297 
298  XYPlot::GridLine::GridLine(vtkSmartPointer<vtkXYPlotActor> plot, int & ds_num, double rgb[3])
299  : ds_num(ds_num++)
300  {
301 
302  X=vtkSmartPointer<vtkDoubleArray>::New();
303  Y=vtkSmartPointer<vtkDoubleArray>::New();
304  X->SetNumberOfTuples(2);
305  Y->SetNumberOfTuples(2);
306  curve=vtkSmartPointer<vtkRectilinearGrid>::New();
307  curve->SetXCoordinates(X);
308  curve->GetPointData()->SetScalars(Y);
309  curve->SetDimensions(2, 1, 1);
310  plot->AddDataSetInput(curve);
311  plot->SetPlotColor(ds_num, rgb);
312  plot->SetPlotLines(ds_num, 1);
313  plot->SetPlotPoints(ds_num,0);
314  }
315 
316 
318  {
319  if (PlotState.grid_show)
320  {
321  double xrange[2];
322  double yrange[2];
323  int mynxlabels;
324  int mynylabels;
325 
326 
327  // nice to have but not with opengl2
328  // https://gitlab.kitware.com/vtk/vtk/issues/15799
329  XYPlotActor->GetProperty()->SetLineStipplePattern(0xf0f0);
330  XYPlotActor->GetProperty()->SetLineStippleRepeatFactor(5);
331 
332 
333  if (PlotState.adjust_labels)
334  {
335  XYPlotActor->GetXAxisActor2D()->GetAdjustedRange(xrange);
336  XYPlotActor->GetYAxisActor2D()->GetAdjustedRange(yrange);
337  mynxlabels=XYPlotActor->GetXAxisActor2D()->GetAdjustedNumberOfLabels();
338  mynylabels=XYPlotActor->GetYAxisActor2D()->GetAdjustedNumberOfLabels();
339  }
340  else
341  {
342  XYPlotActor->GetXRange(xrange);
343  XYPlotActor->GetYRange(yrange);
344  mynxlabels=XYPlotActor->GetNumberOfXLabels();
345  mynylabels=XYPlotActor->GetNumberOfYLabels();
346  }
347 
348  // The number of grid lines can change, so there may be more or less
349  // of them in a new plot. We however keep the once allocated vectors
350  // and have to extend them if they are too short.
351  // If they are too long , we switch off the superfluous ones
352  // (via the second argument in SetPlotLines())
353 
354  for (int i=XGridLines.size();i<mynxlabels; i++)
355  XGridLines.emplace_back(XYPlotActor, num_curves,PlotState.grid_rgb);
356 
357  for (int i=YGridLines.size();i<mynylabels; i++)
358  YGridLines.emplace_back(XYPlotActor, num_curves,PlotState.grid_rgb);
359 
360 
361  double dx=0.999999*(xrange[1]-xrange[0])/(mynxlabels-1);
362  double x=xrange[0]+dx;
363  for (int i=1;i<mynxlabels;i++,x+=dx)
364  {
365  XGridLines[i].SetXLine(yrange,x);
366  XYPlotActor->SetPlotLines(XGridLines[i].GetDataSetNumber(), 1);
367  }
368  for (int i=mynxlabels;i<XGridLines.size();i++)
369  {
370  XYPlotActor->SetPlotLines(XGridLines[i].GetDataSetNumber(), 0);
371  }
372 
373 
374  double dy=0.9999999*(yrange[1]-yrange[0])/(mynylabels-1);
375  double y=yrange[0]+dy;
376  for (int i=1;i<mynylabels;i++,y+=dy)
377  {
378  YGridLines[i].SetYLine(xrange,y);
379  XYPlotActor->SetPlotLines(YGridLines[i].GetDataSetNumber(), 1);
380  }
381  for (int i=mynylabels;i<XGridLines.size();i++)
382  {
383  XYPlotActor->SetPlotLines(YGridLines[i].GetDataSetNumber(), 0);
384  }
385 
386  }
387  }
388 
389  std::map<std::string,int> XYPlot::marker_types
390  {
391  {"+",3},
392  {"plus",3},
393  {"^^",5},
394  {"filled triangle",5},
395  {"^",18},
396  {"triangle",18},
397  {"#",19},
398  {"square",19},
399  {"##",6},
400  {"filled square",6},
401  {"o",20},
402  {"circle",20},
403  {"oo",7},
404  {"filled circle",7},
405  {"d",21},
406  {"diamond",21},
407  {"dd",8},
408  {"filled diamond",8}
409  };
410 
411 
413  {
414  curve->SetDimensions(X->GetNumberOfTuples(), 1, 1);
415  }
416 
418  {
419  return ds_num;
420  }
421 
422  XYPlot::PlotData::PlotData(vtkSmartPointer<vtkXYPlotActor> plot, int & ds_num)
423  : ds_num(ds_num++)
424  {
425  X=vtkSmartPointer<vtkDoubleArray>::New();
426  Y=vtkSmartPointer<vtkDoubleArray>::New();
427  curve=vtkSmartPointer<vtkRectilinearGrid>::New();
428  curve->SetXCoordinates(X);
429  curve->GetPointData()->SetScalars(Y);
430  plot->AddDataSetInput(curve);
431  }
432 
433 
435  {
436 
437 
438 
439  while (num_plots>=AllPlotData.size())
440  {
441  AllPlotData.emplace_back(XYPlotActor,num_curves);
442  }
443 
444  auto plot=AllPlotData[num_plots];
446  plot.FixSize();
447 
448 
449  XYPlotActor->SetPlotColor(plot.GetDataSetNumber(), NextPlotInfo.line_rgb[0], NextPlotInfo.line_rgb[1], NextPlotInfo.line_rgb[2]);
450 
451  int plot_lines = -1;
452  std::string line_type(NextPlotInfo.line_type);
453  if (
454  line_type == ""
455  || line_type == "none"
456  || line_type == "off"
457  )
458  plot_lines = 0;
459  else if (
460  line_type == "-"
461  || line_type == "on"
462  )
463  plot_lines = 1;
464 
465  if (plot_lines==-1)
466  throw std::runtime_error("Unknown line type: "+line_type);
467  XYPlotActor->SetPlotLines(plot.GetDataSetNumber(), plot_lines);
468 
469  int plot_points = -1;
470  std::string marker_type(NextPlotInfo.marker_type);
471  if (
472  marker_type == ""
473  || marker_type == "none"
474  || marker_type == "off"
475  )
476  {
477  plot_points = 0;
478  XYPlotActor->SetPlotGlyphType(plot.GetDataSetNumber(), 1);
479  };
480 
481  if (marker_types.find(marker_type)!=marker_types.end())
482  {
483  plot_points = 1;
484  XYPlotActor->SetPlotGlyphType(plot.GetDataSetNumber(), marker_types[marker_type]);
485  }
486  if (plot_points==-1)
487  throw std::runtime_error("Unknown marker type: "+marker_type);
488 
489  XYPlotActor->SetPlotPoints(plot.GetDataSetNumber(), plot_points);
490 
491 
492 
493 
494  XYPlotActor->SetPlotLabel(plot.GetDataSetNumber(), NextPlotInfo.legend);
495 
496 
497  if (PlotState.fixXMin>PlotState.fixXMax)
498  XYPlotActor->SetXRange(PlotState.dynXMin,PlotState.dynXMax);
499  else
500  XYPlotActor->SetXRange(PlotState.fixXMin,PlotState.fixXMax);
501 
502  if (PlotState.fixYMin>PlotState.fixYMax)
503  XYPlotActor->SetYRange(PlotState.dynYMin,PlotState.dynYMax);
504  else
505  XYPlotActor->SetYRange(PlotState.fixYMin,PlotState.fixYMax);
506 
507  XYPlotActor->SetLegendPosition2(0.15,0.05*(num_plots+1));
508 
509 
510 
511  num_plots++;
512 
513  XYPlotActor->Modified();
514  }
515 
517  {
518  XYPlotActor->SetXLabelFormat(PlotState.ylabel_format);
519  XYPlotActor->SetYLabelFormat(PlotState.ylabel_format);
520  XYPlotActor->SetTitle(title.c_str());
521  XYPlotActor->SetXTitle(xtitle.c_str());
522  XYPlotActor->SetYTitle(ytitle.c_str());
523 
524 
525  XYPlotActor->SetLineWidth(2.0*PlotState.line_width);
526  XYPlotActor->SetGlyphSize(0.01*PlotState.marker_size);
527  PlotGrid();
528 
529  if (PlotState.legend_show)
530  {
531  this->LegendActor->SetNumberOfEntries(num_plots);
532  this->LegendActor->SetPadding(2);
533  for (int iplot=0;iplot<num_plots;iplot++)
534  {
535  int ds_num=AllPlotData[iplot].GetDataSetNumber();
536  this->LegendActor->SetEntryString(iplot,XYPlotActor->GetPlotLabel(ds_num));
537  this->LegendActor->SetEntryColor(iplot, XYPlotActor->GetPlotColor(ds_num));
538  auto symbol=XYPlotActor->GetPlotSymbol(ds_num);
539  if (symbol)
540  this->LegendActor->SetEntrySymbol(iplot,symbol);
541 
542  }
543  this->LegendActor->Modified();
544  }
545  }
546 
547 
548 
549  void XYPlot::ServerRTSend(vtkSmartPointer<internals::Communicator> communicator)
550  {
551  communicator->SendString(title);
552  communicator->SendString(xtitle);
553  communicator->SendString(ytitle);
554 
555  communicator->SendCharBuffer((char*)&PlotState,sizeof(PlotState));
556 
557 
558  communicator->SendInt(num_plots);
559  communicator->SendInt(AllPlotInfo.size());
560  int ndata=AllPlotInfo.size()*sizeof(PlotInfo);
561  communicator->SendCharBuffer((char*)AllPlotInfo.data(),ndata);
562 
563 
564  for (int i=0;i<num_plots;i++)
565  {
566  auto &plot=AllPlotData[i];
567  communicator->Send(plot.X,1,1);
568  communicator->Send(plot.Y,1,1);
569  }
570  };
571 
572  void XYPlot::ClientMTReceive(vtkSmartPointer<internals::Communicator> communicator)
573  {
574  Clear();
575  communicator->ReceiveString(title);
576  communicator->ReceiveString(xtitle);
577  communicator->ReceiveString(ytitle);
578  communicator->ReceiveCharBuffer((char*)&PlotState,sizeof(PlotState));
579 
580  int np;
581  int npi;
582  communicator->ReceiveInt(np);
583  communicator->ReceiveInt(npi);
584  std::vector<PlotInfo> NewPlotInfo(npi);
585  char *data=(char*)NewPlotInfo.data();
586  int ndata=npi*sizeof(PlotInfo);
587  communicator->ReceiveCharBuffer(data,ndata);
588 
589 
590  for (int i=0;i<np;i++)
591  {
592  while (num_plots>=AllPlotData.size())
593  {
594  AllPlotData.emplace_back(XYPlotActor,num_curves);
595  }
596 
597  auto plot=AllPlotData[num_plots];
598  NextPlotInfo=NewPlotInfo[i];
599  communicator->Receive(plot.X,1,1);
600  communicator->Receive(plot.Y,1,1);
601  AddPlot();
602  }
603  };
604 
605 
606 }
std::vector< PlotInfo > AllPlotInfo
Vector holding all plot info.
Definition: vtkfigXYPlot.h:274
void SetPlotMarkerType(const std::string type)
Set marker type.
std::vector< GridLine > YGridLines
vector holding grid lines
Definition: vtkfigXYPlot.h:209
void SetXRange(double x0, double x1)
Set the range of the x values.
void SetYTitle(const std::string t)
Set the title of the y axis.
void ClientMTReceive(vtkSmartPointer< internals::Communicator > communicator) override final
Server-Client receive.
void ShowLegend(bool b)
Show a legend box ?
void SetPlotColor(double r, double g, double b)
Set the color of the next plot.
vtkSmartPointer< vtkRectilinearGrid > curve
Definition: vtkfigXYPlot.h:214
void SetGridColor(double r, double g, double b)
Set the color of the grid lines.
void RTAddActor2D(vtkSmartPointer< vtkActor2D > prop)
Add vtk Actor to renderer showing figure.
static std::map< std::string, int > marker_types
Possible types of plot markers.
Definition: vtkfigXYPlot.h:163
Base class for all figures.
Definition: vtkfigFigure.h:52
void SetXLine(double yrange[2], double x)
vtkSmartPointer< vtkDoubleArray > X
Definition: vtkfigXYPlot.h:217
int GetDataSetNumber()
Return dataset number in XYPLotActor.
Definition: vtkfigXYPlot.h:199
virtual std::string SubClassName() override final
Get subclass name (for s-c communication, should be replaced by tag.
void SetXTitle(const std::string t)
Set the title of the x axis.
void SetPlotLegend(const std::string legend)
Set the information for the legend entry for the next plot.
void AddPlot()
Internal addplot after plot data have been filled.
void SetNumberOfXLabels(int n)
Set the number of x axis labels.
std::string xtitle
Definition: vtkfigXYPlot.h:187
static std::shared_ptr< XYPlot > New()
struct vtkfig::XYPlot::@4 PlotState
General state of the XYPlot.
vtkSmartPointer< vtkXYPlotActor > XYPlotActor
The main graphics actor.
Definition: vtkfigXYPlot.h:175
void FixSize()
Fix curve size to X size.
void RTPreRender() override final
Pre render actions.
char marker_type[desclen]
Definition: vtkfigXYPlot.h:266
PlotInfo NextPlotInfo
"finite state machine" struture accumulating repective info for next plot
Definition: vtkfigXYPlot.h:278
void ServerRTSend(vtkSmartPointer< internals::Communicator > communicator) override final
Server-Client send.
PlotData(vtkSmartPointer< vtkXYPlotActor > plot, int &ds_num)
void SetTitle(const std::string t)
Set the title of the plot.
vtkSmartPointer< vtkRectilinearGrid > curve
Definition: vtkfigXYPlot.h:195
void AdjustLabels(bool b)
Adjust labels to "nice values" ?
vtkSmartPointer< vtkLegendBoxActor > LegendActor
We create our own legend box.
Definition: vtkfigXYPlot.h:180
void SetNumberOfYLabels(int n)
Set the number of y axis labels.
int num_curves
Number of all curves including grid lines.
Definition: vtkfigXYPlot.h:172
void SetXAxisLabelFormat(const std::string fmt)
Set the format string for x axis labels.
void RTBuildAllVTKPipelines(vtkSmartPointer< vtkRenderer > renderer) override final
Build vtk.
void SetPlotLineType(const std::string type)
Set the line type of the next plot.
vtkSmartPointer< vtkDoubleArray > X
Definition: vtkfigXYPlot.h:193
void SetLegendPosition(double x, double y)
Set the position of the legend box.
std::vector< GridLine > XGridLines
vector holding grid lines
Definition: vtkfigXYPlot.h:206
size_t num_plots
Number of "real" plots.
Definition: vtkfigXYPlot.h:166
void SetLegendSize(double w, double h)
Set the size of the legend box.
vtkSmartPointer< vtkDoubleArray > Y
Definition: vtkfigXYPlot.h:218
void SetMarkerSize(double s)
Set the size of all markers in the plot.
void SetAxesColor(double r, double g, double b)
Set the color of the axes.
void SetLineWidth(double w)
Set the width of all lines in the plot.
Info for particular plot lne.
Definition: vtkfigXYPlot.h:262
void ShowGrid(bool b)
Show grid lines in the plot ?
void SetYLine(double xrange[2], double y)
void SetYAxisLabelFormat(const std::string fmt)
Set the format string for y axis labels.
std::vector< PlotData > AllPlotData
vector holding data of all plots
Definition: vtkfigXYPlot.h:227
std::string title
Definition: vtkfigXYPlot.h:185
void PlotGrid()
Plot the label grid.
std::string ytitle
Definition: vtkfigXYPlot.h:186
void SetYRange(double y0, double y1)
Set the range of the y values.
GridLine(vtkSmartPointer< vtkXYPlotActor > plot, int &ds_num, double rgb[3])
vtkSmartPointer< vtkDoubleArray > Y
Definition: vtkfigXYPlot.h:194
static const int desclen
Fixed length string size.
Definition: vtkfigXYPlot.h:184
void Clear()
Remove all data from plot.