#ifndef _PLOT_H_ #define _PLOT_H_ #include #include #include #include "XWindow.h" using namespace Cairo; struct Color { double red, green, blue, alpha; }; class PlotSeries : public std::list { public: Color color; enum Style { STYLE_LINE, STYLE_SPLINE, STYLE_SCATTER } style; PlotSeries(enum Style style, Color color); void draw(RefPtr ctx); }; class Plot { friend class PlotSeries; public: Plot(int width = 400, int height = 300); virtual ~Plot(); void draw(); std::list series; protected: RefPtr window; RefPtr surface; int width, height; void drawAxes(RefPtr ctx); void drawTicks(RefPtr ctx); static const int PADDING = 20; }; #endif /* _PLOT_H_ */