Fill Between Demo

Fill Between Demo

Source: fill_between_demo.f90

Create filled regions using both the stateful API and figure_t.

The demo highlights part of an oscillatory curve and shades a baseline response.

make example ARGS="fill_between_demo"

Generated files are written to output/example/fortran/fill_between_demo/ in both PNG and ASCII formats.

Files

  • fill_between_demo.f90 - Source code
  • Generated media in output/example/fortran/fill_between_demo/

Running

make example ARGS="fill_between_demo"

Output

Oo Fill Between

oo_fill_between.png

ASCII output:



                        Object API fill_between baseline
+--------------------------------------------------------------------------------+
|                                                                                |
| 0.8                                                                            |
| |                      ---                                                     |
| |                 --------------                                               |
| 0.6             ------------------                                             |
| |             ----------------------                                           |
| |           --------------------------                                         |
| 0.4        -----------------------------                                       |
| |        ---------------------------------                                     |
| |       -----------------------------------                                    |
| 0.2    --------------------------------------                                  |
| |     ----------------------------------------                                 |
| |    -------------------------------------------                               |
| 0.0 ---------------------------------------------                              |
| |  -----------------------------------------------------------------------     |
| |                                                  -----------------------     |
| |                                                   ----------------------     |
| |                                                     --------------------     |
| -0.2                                                    ------------------     |
| -0.4                                                      ----------------     |
| |                                                           --------------     |
| |                                                              -----------     |
| +--+----------+-----------+-----------+-----------+-----------+-----------+--- |
|    0          1           2           3           4           5           6    |
+--------------------------------------------------------------------------------+
                                      time
response

Download ASCII

Download PDF

Stateful Fill Between

stateful_fill_between.png

ASCII output:



                        Stateful fill_between with mask
+--------------------------------------------------------------------------------+
| 1.00                                                                           |
| |                                                                              |
| |                   --                                                         |
| 0.75           ------------                                       --- sin(x)   |
| |            ----------------                                                  |
| 0.50       -------------------                                                 |
| |         ----------------------                                               |
| |        ------------------------                                              |
| |      ----------       -----------                                            |
| 0.25  -------                -------                                           |
| |    -----                      -----                                          |
| 0.00----                           ---                                         |
| |  --                                ---                                 -     |
| |                                      --                               -      |
| -0.25                                   --                            --       |
| |                                        --                          --        |
| -0.50                                     --                        --         |
| |                                           --                    --           |
| |                                            --                  --            |
| -0.75                                          --              ---             |
| |                                               ---          ---               |
| -1.00                                             -----  -----                 |
| +--+----------+----------+----------+-----------+----------+----------+------- |
|    0          1          2          3           4          5          6        |
+--------------------------------------------------------------------------------+
                                  angle (rad)
amplitude

Download ASCII

Download PDF