|
1 | | - |
2 | 1 | \DeclareRobustCommand{\plot}[2][]{ |
3 | 2 | \begin{tikzpicture} |
4 | 3 | \begin{axis}[ |
5 | | - width=\textwidth, height=0.6172\textwidth, |
| 4 | + width=0.95\textwidth, height=0.6172\textwidth, |
6 | 5 | xlabel={ {{xaxis.label}} }, ylabel={ {{yaxis.label}} }, |
7 | 6 | xtick=data, xtick align=outside, |
| 7 | + ylabel style={font=\scriptsize}, |
| 8 | + xlabel style={font=\scriptsize}, |
8 | 9 | xticklabels from table={{'{#2}'}}{{'{'}}{{xaxis.parameter}}{{'}'}}, |
| 10 | + xticklabel style={rotate=45, anchor=east, font=\scriptsize}, |
| 11 | + yticklabel style={font=\scriptsize}, |
9 | 12 | ymajorgrids=true, yminorgrids=true, |
10 | 13 | bar width=7pt, |
11 | 14 | cycle list name=color list, |
12 | 15 | ybar, |
13 | | - legend style={at={(0.5,-0.1)},anchor=north} |
| 16 | + legend to name=customlegend, |
| 17 | + legend style={font=\small} |
14 | 18 | ] |
15 | 19 | {% for col in columns %} |
16 | 20 | \addplot table [x expr=\coordindex, y={{ col }}] {{'{#2}'}} ; |
|
28 | 32 |
|
29 | 33 |
|
30 | 34 | \begin{figure}[H] |
| 35 | + \centering |
| 36 | + {% if anim_dimension_values %} |
| 37 | + {% set n = anim_dimension_values | length %} |
| 38 | + {% set ncols = (n**0.5) | round(0, 'ceil') %} |
| 39 | + {% set nrows = (n / ncols) | round(0, 'ceil') %} |
| 40 | + {% set subfig_width = ((0.95 / ncols) | round(3)) %} |
31 | 41 |
|
32 | | -{% if anim_dimension_values %} |
33 | | - {% for dim in anim_dimension_values %} |
34 | | - \plot{\data{{ loop.index | inttouniquestr }}} |
35 | | - \caption{ {{secondary_axis.label}}={{dim}} } |
36 | | - {% endfor %} |
37 | | -{% else %} |
38 | | - \plot{\data{{1 | inttouniquestr }}} |
39 | | -{% endif %} |
40 | | -\caption{ {{caption}} } |
| 42 | + {% for dim in anim_dimension_values %} |
| 43 | + \begin{subfigure}[t]{ {{subfig_width}}\textwidth} |
| 44 | + \centering |
| 45 | + \plot{\data{{ loop.index | inttouniquestr }}} |
| 46 | + \caption{ {{secondary_axis.label}}={{dim}} } |
| 47 | + \end{subfigure} |
| 48 | + {% if (loop.index0 + 1) % ncols == 0 %} |
| 49 | + \par\vspace{1em} |
| 50 | + {% endif %} |
| 51 | + {% endfor %} |
| 52 | + {% else %} |
| 53 | + \plot{\data{{1 | inttouniquestr }}} |
| 54 | + {% endif %} |
| 55 | + \vspace{1em} |
| 56 | + \centering |
| 57 | + \pgfplotslegendfromname{customlegend} |
| 58 | + \caption{ {{caption}} } |
41 | 59 | \end{figure} |
0 commit comments