Source: bar_chart_demo.f90
Demonstrates grouped bar charts (vertical and horizontal) via both the stateful API and figure_t.
bar_chart_demo.f90 - Source demonstrating grouped and horizontal barsGenerated outputs in output/example/fortran/bar_chart_demo/
Grouped bars: Compare multiple series per category
bar_impl with an explicit figure_t instance to avoid globalsRunning the demo generates:
- stateful_grouped.(png|pdf|txt) - Vertical grouped comparison
- stateful_horizontal.(png|pdf|txt) - Horizontal completion chart
- oo_grouped.(png|pdf|txt) - Object API grouped budget comparison
Perfect for showcasing categorical comparisons and verifying bar chart support in fortplot.
bar_chart_demo.f90 - Source codeoutput/example/fortran/bar_chart_demo/make example ARGS="bar_chart_demo"

ASCII output:
Categorical Bar Chart - Fruit Sales
+--------------------------------------------------------------------------------+
| 60 |
| * ------------- |
| * ------------- |
| 50 ------------- |
| * ------------- ------------- |
| * ------------- ------------- |
| * ------------- ------------- -------------- |
| 40 ------------- ------------- -------------- |
| *------------ ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| 30----------- ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| 20----------- ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| 10----------- ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| *------------ ------------- ------------- ------------- -------------- |
| *--*---*---*- *---*---*--*-- * --*---*---*-- * --*--*---*---* -*---*---*---* |
| 1 2 3 4 5 |
+--------------------------------------------------------------------------------+
Fruit Type
Units Sold

ASCII output:
Object API - grouped budget comparison
+--------------------------------------------------------------------------------+
| |
| =========== |
| 4 =========== |
| * # Baseline=== |
| * # Projected== |
| * ========== ----------=========== |
| * ========== ----------=========== |
| 3 ========== ---------- ========== ----------=========== |
| * ========== ---------- ========== ----------=========== |
| * ========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| ----------========== ---------- ========== ----------=========== |
| 2---------========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| 1---------========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| *---------========== ---------- ========== ----------=========== |
| *------*--====*===== * *------*-- ===*======* *------*---===*======* |
| 1.0 1.5 2.0 2.5 3.0 |
+--------------------------------------------------------------------------------+
Team
Quarterly budget (M$)

ASCII output:
Stacked Bar Chart - Department Expenses
+--------------------------------------------------------------------------------+
| |
| 35 %%%%%%%%%%%%%%%%%% |
| * %%%%%%%%%%%%%%%%%% |
| * %%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% %# Manufacturing%% |
| * %%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% %# Sales%%%%%%%%%% |
| 30 %%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% %# R&D%%%%%%%%%%%% |
| * %===%===%===%===% %===%===%===%===% %===%===%===%====% |
| *%%%%%%%%%%%%%%%% ================= ================= ================== |
| 25%%%%%%%%%%%%%%% ================= ================= ================== |
| *%%%%%%%%%%%%%%%% ================= ================= ================== |
| *===%===%===%===% ================= ================= ================== |
| 20=============== ================= ================= =---=---=---=----= |
| *================ =---=---=---=---= ================= ------------------ |
| *================ ----------------- =---=---=---=---= ------------------ |
| 15--=---=---=---= ----------------- ----------------- ------------------ |
| *---------------- ----------------- ----------------- ------------------ |
| *---------------- ----------------- ----------------- ------------------ |
| 10--------------- ----------------- ----------------- ------------------ |
| *---------------- ----------------- ----------------- ------------------ |
| *---------------- ----------------- ----------------- ------------------ |
| 5---------------- ----------------- ----------------- ------------------ |
| *---------------- ----------------- ----------------- ------------------ |
| *---*----*----*-- *----*---*----*--- * ---*----*---*----* --*----*----*---*- |
| 1.0 1.5 2.0 2.5 3.0 3.5 4.0 |
+--------------------------------------------------------------------------------+
Quarter
Expenses (million $)

ASCII output:
Stateful API - grouped bar chart
+--------------------------------------------------------------------------------+
| |
| * --------- |
| 6 --------- |
| * --------- -----# Product A |
| * --------- --------- -----# Product B== |
| 5 --------- --------- --------========== |
| * --------- --------========= --------========== |
| * --------- --------========= --------========== |
| *-------- --------========= --------========= --------========== |
| 4-------- --------========= --------========= --------========== |
| *-------- --------========= --------========= --------========== |
| *-------- --------========= --------========= --------========== |
| 3-------========= --------========= --------========= --------========== |
| *-------========= --------========= --------========= --------========== |
| *-------========= --------========= --------========= --------========== |
| *-------========= --------========= --------========= --------========== |
| 2-------========= --------========= --------========= --------========== |
| *-------========= --------========= --------========= --------========== |
| *-------========= --------========= --------========= --------========== |
| 1-------========= --------========= --------========= --------========== |
| *-------========= --------========= --------========= --------========== |
| *-------========= --------========= --------========= --------========== |
| *---*---=*====*== *----*---*====*=== * ---*----*===*====* --*----*====*===*= |
| 1.0 1.5 2.0 2.5 3.0 3.5 4.0 |
+--------------------------------------------------------------------------------+
Quarter
Revenue (million $)

ASCII output:
Stateful API - horizontal bar chart
+--------------------------------------------------------------------------------+
| |
| 4.0--------------------------------------------------------------------------- |
| *----------------------------------------------------------------------------- |
| *-------------------------------------------------# Certification completion-- |
| 3.5--------------------------------------------------------------------------- |
| ------------------------------------------------------------------------------ |
| * |
| *----------------------------------------------------------------------- |
| 3.0--------------------------------------------------------------------- |
| *----------------------------------------------------------------------- |
| *----------------------------------------------------------------------- |
| 2.5--------------------------------------------------------------------- |
| |
| *------------------------------------------------------- |
| 2.0----------------------------------------------------- |
| *------------------------------------------------------- |
| -------------------------------------------------------- |
| *------------------------------------------------------- |
| 1.5 |
| -------------------------------------------------------------- |
| *------------------------------------------------------------- |
| 1.0----------------------------------------------------------- |
| ***************************************************************************** |
|0 20 40 60 80 |
+--------------------------------------------------------------------------------+
Completion (%)
Training module