43 #include <visp3/core/vpConfig.h>
44 #include <visp3/core/vpDebug.h>
46 #include <visp3/core/vpMath.h>
47 #include <visp3/gui/vpPlot.h>
51 #if defined(VISP_HAVE_DISPLAY)
53 vpPlot plot(2, 700, 700, 100, 200,
"Curves...");
68 strncpy(title,
"cos function", 40);
69 plot.setTitle(0, title);
70 strncpy(title,
"sin function", 40);
71 plot.setTitle(1, title);
75 strncpy(legend,
"cos x", 40);
76 plot.setLegend(0, 0, legend);
77 strncpy(legend,
"sin x", 40);
78 plot.setLegend(1, 0, legend);
82 strncpy(unit,
"x", 40);
83 plot.setUnitX(0, unit);
84 strncpy(unit,
"x", 40);
85 plot.setUnitX(1, unit);
88 strncpy(unit,
"y", 40);
89 plot.setUnitY(0, unit);
90 strncpy(unit,
"y", 40);
91 plot.setUnitY(1, unit);
95 while (i <= 20 * 2 * M_PI) {
98 plot.plot(0, 0, i, co);
99 plot.plot(1, 0, i, si);
106 plot.saveData(0,
"dataCos.txt",
"# ");
107 plot.saveData(1,
"dataSin.txt",
"# ");
110 std::cout <<
"Catch an exception: " << e << std::endl;
115 std::cout <<
"Plot functionalities are not avalaible since no display is "
static const vpColor green
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
error that can be emitted by ViSP classes.
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...