@@ -17,6 +17,12 @@ namespace gnuplotpp {
1717/* * @brief Output file formats supported by the renderer. */
1818enum class OutputFormat { Pdf, Svg, Eps, Png };
1919
20+ /* * @brief Figure-wide palette selection for automatic series colors. */
21+ enum class ColorPalette { Default, Tab10, Viridis, Grayscale };
22+
23+ /* * @brief Text rendering mode used by terminal setup. */
24+ enum class TextMode { Enhanced, Plain, LaTeX };
25+
2026/* * @brief Built-in publication presets for size and style defaults. */
2127enum class Preset {
2228 IEEE_SingleColumn,
@@ -46,10 +52,64 @@ struct FigureSpec {
4652 Preset preset = Preset::IEEE_SingleColumn;
4753 FigureSizeInches size{};
4854 Style style{};
55+ ColorPalette palette = ColorPalette::Default;
56+ TextMode text_mode = TextMode::Enhanced;
4957 int rows = 1 ;
5058 int cols = 1 ;
5159 std::vector<OutputFormat> formats{OutputFormat::Pdf};
5260 std::string title;
61+ bool write_manifest = false ;
62+ };
63+
64+ /* * @brief Legend placement presets. */
65+ enum class LegendPosition {
66+ TopRight,
67+ TopLeft,
68+ BottomRight,
69+ BottomLeft,
70+ OutsideRight,
71+ OutsideBottom
72+ };
73+
74+ /* * @brief Legend configuration for one axes. */
75+ struct LegendSpec {
76+ bool enabled = true ;
77+ LegendPosition position = LegendPosition::TopRight;
78+ int columns = 1 ;
79+ bool boxed = false ;
80+ bool opaque = false ;
81+ bool has_font_pt = false ;
82+ double font_pt = 8.0 ;
83+ };
84+
85+ /* * @brief Typed label annotation. */
86+ struct LabelAnnotation {
87+ std::string text;
88+ std::string at = " graph 0.05,0.95" ;
89+ std::string font;
90+ bool front = true ;
91+ };
92+
93+ /* * @brief Typed arrow annotation. */
94+ struct ArrowAnnotation {
95+ std::string from = " graph 0.1,0.9" ;
96+ std::string to = " graph 0.2,0.8" ;
97+ bool heads = true ;
98+ double line_width_pt = 1.0 ;
99+ std::string color = " #000000" ;
100+ bool front = true ;
101+ };
102+
103+ /* * @brief Typed rectangle object for highlights/masks. */
104+ struct RectObject {
105+ std::string from = " graph 0.1,0.1" ;
106+ std::string to = " graph 0.2,0.2" ;
107+ bool has_fill_opacity = false ;
108+ double fill_opacity = 0.15 ;
109+ std::string fill_color = " #000000" ;
110+ bool border = false ;
111+ std::string border_color = " #000000" ;
112+ bool front = false ;
53113};
54114
55115/* * @brief Axes-level labels, limits, and grid/log controls. */
@@ -59,6 +119,7 @@ struct AxesSpec {
59119 std::string ylabel;
60120 bool grid = false ;
61121 bool legend = true ;
122+ LegendSpec legend_spec{};
62123
63124 bool has_xlim = false ;
64125 double xmin = 0.0 ;
@@ -71,12 +132,27 @@ struct AxesSpec {
71132 bool xlog = false ;
72133 bool ylog = false ;
73134
135+ bool has_xtick_step = false ;
136+ double xtick_step = 1.0 ;
137+ bool has_ytick_step = false ;
138+ double ytick_step = 1.0 ;
139+ bool has_xminor_count = false ;
140+ int xminor_count = 2 ;
141+ bool has_yminor_count = false ;
142+ int yminor_count = 2 ;
143+ std::string xformat;
144+ std::string yformat;
145+
146+ std::vector<LabelAnnotation> labels;
147+ std::vector<ArrowAnnotation> arrows;
148+ std::vector<RectObject> rectangles;
149+
74150 // Optional raw gnuplot commands for advanced annotations (arrows/labels/etc).
75151 std::vector<std::string> gnuplot_commands;
76152};
77153
78154/* * @brief Supported series drawing types. */
79- enum class SeriesType { Line, Scatter, ErrorBars, Band };
155+ enum class SeriesType { Line, Scatter, ErrorBars, Band, Histogram, Heatmap };
80156
81157/* * @brief Series metadata and optional per-series style override. */
82158struct SeriesSpec {
@@ -100,6 +176,8 @@ struct SeriesData {
100176 SeriesSpec spec;
101177 std::vector<double > x;
102178 std::vector<double > y;
179+ std::vector<double > y2;
180+ std::vector<double > z;
103181};
104182
105183/* *
@@ -124,6 +202,43 @@ class Axes {
124202 std::span<const double > x,
125203 std::span<const double > y);
126204
205+ /* *
206+ * @brief Add a confidence band from lower/upper curves.
207+ * @param spec Series style metadata.
208+ * @param x X samples.
209+ * @param y_low Lower bound values.
210+ * @param y_high Upper bound values.
211+ * @throws std::invalid_argument if lengths differ.
212+ */
213+ void add_band (const SeriesSpec& spec,
214+ std::span<const double > x,
215+ std::span<const double > y_low,
216+ std::span<const double > y_high);
217+
218+ /* *
219+ * @brief Add a histogram-style series from bin centers and counts.
220+ * @param spec Series metadata.
221+ * @param bin_centers Histogram bin centers.
222+ * @param counts Histogram values.
223+ * @throws std::invalid_argument if lengths differ.
224+ */
225+ void add_histogram (const SeriesSpec& spec,
226+ std::span<const double > bin_centers,
227+ std::span<const double > counts);
228+
229+ /* *
230+ * @brief Add heatmap samples as x/y/z triplets.
231+ * @param spec Series metadata.
232+ * @param x X coordinates.
233+ * @param y Y coordinates.
234+ * @param z Intensity values.
235+ * @throws std::invalid_argument if lengths differ.
236+ */
237+ void add_heatmap (const SeriesSpec& spec,
238+ std::span<const double > x,
239+ std::span<const double > y,
240+ std::span<const double > z);
241+
127242 /* * @return Current axes configuration. */
128243 const AxesSpec& spec () const { return spec_; }
129244
0 commit comments