Ascii art plotting in Fortran

I would like to have a library like Julia has for ascii art plotting and I would like to be able to do this in Fortran:

https://twitter.com/gabrielweymouth/status/1393214212219023371

There is a whole animation on the link above, but one still image looks like this:

The original plot from 1973 is done in F66 I assume:

I don’t have time to do this myself, but if anyone is looking for a project, this would be very useful!

11 Likes

@certik , I have found that Fortran small library (160 lines):
https://sites.google.com/site/akohlmey/random-hacks/text-mode-graphics-for-fortran

The code is a the bottom of the page (text_viz.f90.gz). I have not tested it and don’t know if you can make an animation (but probably).

This is the header of the module:

! small module to do text mode graphics using ANSI terminal escape sequences
! Copyright (c) 2013 Axel Kohlmeyer akohlmey@gmail.com
! v0.1 2013-06-22, initial public version
! v0.2 2013-06-24, better autoscale and overflow protection

MODULE text_viz

4 Likes

Clever, it just normalizes the value and chooses a proper character for it from

  CHARACTER, PARAMETER :: plot(0:maxplot) = (/ &
      ' ', '.', ',', ':', '=', '+', 'o', 'x', 'X', '#', '@' /)
3 Likes

There’s a copy of the paper available at https://math.berkeley.edu/~chorin/jfm73.pdf

The calculations were done on a CDC 6400, but there is no mention of the programming language (the paper does say the computer program is available from the author).

2 Likes

It was most probably Fortran 66 (Fortran IV with some extensions). The CDC 6000 series were excellent computers for obtaining numerical solutions of physical problems. Some of the CDC installations had, in addition, the student oriented MNF computer, which was faster to compile, and gave better diagnostic messages. Users typically developed and debugged their programs using MNF first, and then switched to the CDC Fortran compilers (RUN, FUN and FTN) for faster execution.

The assembly language was COMPASS. (Note the peculiar dedication note in page 3 of the manual. Address registers A6 and A7 were used for writing the contents of registers into central memory. Setting an address into A6 caused the contents of register X6 to be stored into that address.)

Some of the CDC 6000 series computers had Wirth’s Pascal compiler. Some even had an Algol compiler. Unfortunately, Algol programs ran extremely slowly compared to the corresponding Fortran programs.

2 Likes

Something like this will be super useful:

For publication ready figures, we can use Matlab, etc. Having a Unicode plot package in Fortran will be fantastic.

3 Likes

Maybe:

“Lawrence Berkeley Laboratory Annual Report (1976)” https://www.iaea.org/inis/collection/NCLCollectionStore/_Public/09/381/9381276.pdf

Modern
flow

1 Like

ANSI Art and ASCII Art: The world around us - Text Art Animation - ASCII Art - YouTube

1 Like