Skip to content

Commit e900114

Browse files
pgf : support categorical xaxis in plots #170
1 parent dde9410 commit e900114

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/feelpp/benchmarking/report/figures/templates/tikz/groupedBarChart.tex.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
width=\textwidth, height=0.6172\textwidth,
1616
xlabel={ {{xaxis.label}} }, ylabel={ {{yaxis.label}} },
1717
xtick=data, xtick align=outside,
18+
xticklabels from table={{'{#2}'}}{{'{'}}{{xaxis.parameter}}{{'}'}},
1819
ymajorgrids=true, yminorgrids=true,
1920
bar width=7pt,
2021
cycle list name=color list,
2122
ybar,
2223
legend style={at={(0.5,-0.1)},anchor=north}
2324
]
2425
{% for var,name in zip(variables,names) %}
25-
\addplot table [x={{xaxis.parameter}}, y={{ var }}] {{'{#2}'}} ;
26+
\addplot table [x expr=\coordindex, y={{ var }}] {{'{#2}'}} ;
2627
\addlegendentry{ {{name}} }
2728
{% endfor %}
2829

src/feelpp/benchmarking/report/figures/templates/tikz/scatterChart.tex.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@
1717
xlabel={ {{xaxis.label}} }, ylabel={ {{yaxis.label}} },
1818
xtick=data, xtick align=outside,
1919
ymajorgrids=true, yminorgrids=true,
20+
xticklabels from table={{'{#2}'}}{{'{'}}{{xaxis.parameter}}{{'}'}},
2021
cycle list name=color list, legend style={at={(0.5,-0.1)},anchor=north}
21-
#1
2222
]
2323
{% for var,name in zip(variables,names) %}
2424
{% if var not in fill_lines %}
25-
\addplot table [x={{xaxis.parameter}}, y={{ var }}] {{'{#2}'}} ;
25+
\addplot table [x expr=\coordindex, y={{ var }}] {{'{#2}'}} ;
2626
\addlegendentry{ {{name}} }
2727
{% endif %}
2828
{% endfor %}
2929

3030
{% for fill_col in fill_lines %}
31-
\addplot[black, name path={{fill_col}}] table [x={{xaxis.parameter}}, y={{ fill_col }}] {{'{#2}'}} ;
31+
\addplot[black, name path={{fill_col}}] table [x expr=\coordindex, y={{ fill_col }}] {{'{#2}'}} ;
3232
\addlegendentry{ {{fill_col}} }
3333
{% endfor %}
3434
{% if fill_lines %}

src/feelpp/benchmarking/report/figures/templates/tikz/stackedBarChart.tex.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
\begin{axis}[
3030
width=\textwidth, height=0.6172\textwidth,
3131
xlabel={ {{xaxis.label}} }, ylabel={ {{yaxis.label}} },
32+
xticklabels from table={\dataA}{{'{'}}{{xaxis.parameter}}{{'}'}},
3233
xtick=data, xtick align=outside,
3334
ymajorgrids=true, yminorgrids=true,
3435
bar width=7pt,
@@ -43,7 +44,7 @@
4344
\resetstackedplots
4445
{% endif %}
4546
{% for var,name in zip(variables,names) %}
46-
\addplot table [x={{xaxis.parameter}}, y={{ var }}] {\data{{i | inttouniquestr}}} ;
47+
\addplot table [x expr=\coordindex, y={{ var }}] {\data{{i | inttouniquestr}}} ;
4748
{% if i == 1%}
4849
\addlegendentry{ {{name}} }
4950
{% endif %}

0 commit comments

Comments
 (0)