Creating graphs or visuals in the early days of computing, particularly with limited resources like line printers and languages like FORTRAN, required a combination of ingenuity, creativity, and leveraging the tools available at the time. During the 1950s to 1970s, when graphical displays and plotters were either non-existent or prohibitively expensive, programmers and engineers used text-based methods and rudimentary hardware to produce visualizations. Here's how they managed to create graphs and visuals under such constraints:
-
ASCII Art and Text-Based Graphics on Line Printers:
- Line printers, which were common output devices in early computing, could only print text characters (letters, numbers, and symbols) in fixed-width fonts, typically on continuous paper. To create visuals, programmers used these characters to form rough approximations of graphs and shapes, a technique often referred to as "ASCII art."
- For example, to draw a simple line graph or histogram, programmers would use characters like
*
,#
, or|
to represent data points or bars, with spaces for empty areas. The x-axis and y-axis might be labeled using numbers or letters printed along the edges. - FORTRAN programs were written to calculate the data points and then output a grid of characters to the line printer, aligning them to form a visual representation. This required careful planning of the scale and layout to fit within the printer's line width (often 80 or 132 characters).
Example Process:
- Calculate data points (e.g., a sine wave).
- Map the data to a discrete grid of character positions.
- Print rows of characters where each row represents a y-value, using
*
for data points and spaces for empty areas.
-
Scaling and Data Mapping:
- Since line printers had no inherent graphical capabilities, programmers had to manually scale data to fit within the constraints of the printer's resolution (i.e., number of lines and characters per line). For instance, a dataset with values ranging from -100 to 100 might be scaled to fit within 50 lines of text.
- FORTRAN’s arithmetic capabilities were used to normalize and transform data into a printable range. Loops and conditional statements helped decide which character to print at each position.
-
Use of Overprinting for Density:
- Some line printers allowed overprinting, where multiple characters could be printed on the same spot by not advancing the paper. This was used to create a sense of shading or density. For example, printing multiple
*
or other characters on top of each other could simulate darker areas in a graph. - This technique required precise control over printer commands, often embedded in the FORTRAN output using format statements (
FORMAT
) to suppress line feeds.
- Some line printers allowed overprinting, where multiple characters could be printed on the same spot by not advancing the paper. This was used to create a sense of shading or density. For example, printing multiple
-
Paper Tape and Punched Cards for Output Control:
- Early systems often used punched cards or paper tape as input and sometimes for controlling output. Programmers could encode specific printer instructions alongside data to manipulate how the line printer behaved, though this was limited compared to modern escape sequences.
- FORTRAN programs would generate output files or directly send data to the printer, with instructions for spacing and character placement hardcoded in the program.
-
Specialized Plotting Libraries in FORTRAN:
- As computing evolved in the 1960s and 1970s, some FORTRAN libraries and subroutines were developed to assist with creating text-based graphs or interfacing with early plotting devices. For instance, libraries like CALCOMP (used with early pen plotters) provided subroutines that could be called from FORTRAN to draw lines, points, and labels.
- Even without physical plotters, some of these libraries could generate printer-compatible output to simulate plots on paper.
-
Early Plotters and Specialized Hardware:
- When resources allowed, early mechanical plotters (like the Calcomp plotter) were used in conjunction with FORTRAN. These devices used pens to draw on paper based on instructions generated by FORTRAN programs. Commands to move the pen (
PLOT
,DRAW
) were often part of specialized libraries. - However, plotters were expensive and not widely available, so they were typically reserved for research institutions or large organizations. Most programmers still relied on line printers for everyday visualization needs.
- When resources allowed, early mechanical plotters (like the Calcomp plotter) were used in conjunction with FORTRAN. These devices used pens to draw on paper based on instructions generated by FORTRAN programs. Commands to move the pen (
-
Manual Post-Processing:
- In some cases, output from line printers was just a starting point. Engineers and scientists would manually annotate or enhance the printed graphs by hand, adding labels, connecting points with rulers, or overlaying grids on the paper. This was common in academic and engineering settings where precision was needed for analysis or publication.
- FORTRAN output might include numeric data alongside the text graph, allowing users to interpret or refine the visual manually.
-
Teletype Terminals as an Alternative:
- Teletype terminals, another early output device, were sometimes used instead of or alongside line printers. These could also produce text-based graphs in a similar manner, though their output was slower and often limited to a narrower width.
- FORTRAN programs would be adapted to send output to these devices with similar character-based plotting techniques.
Challenges and Limitations
- Resolution: The low resolution of line printers (limited by character grid) meant that graphs were coarse and lacked detail. Curves and diagonal lines often appeared jagged or stepped.
- Time-Consuming: Designing a program to output a usable graph was labor-intensive, requiring trial and error to get scaling and alignment right.
- Hardware Constraints: Printers and terminals varied widely in their capabilities, so programs often needed to be tailored to specific hardware, reducing portability.
- Lack of Interactivity: There was no way to dynamically adjust or interact with the graph; each change required modifying the FORTRAN code and reprinting the output.
Cultural and Historical Context
During this era, computing resources were scarce, and the focus was on functionality over aesthetics. Programmers and engineers valued getting any visual representation of data, even if it was crude by today’s standards. These text-based graphs were often sufficient for identifying trends, debugging algorithms, or presenting data in reports. The skills developed in working around these limitations also fostered a deep understanding of data representation and resource optimization—principles that remain valuable in computing today.
Example FORTRAN Code Snippet for a Simple Text Graph
Below is a simplified example of how a FORTRAN program might create a basic histogram on a line printer:
PROGRAM HISTOGRAM
INTEGER I, J
REAL DATA(10)
CHARACTER*1 GRID(50,10)
! Sample data
DATA DATA /1.0, 2.0, 3.0, 4.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0/
! Initialize grid with spaces
DO I=1,50
DO J=1,10
GRID(I,J) = ' '
ENDDO
ENDDO
! Fill grid with '*' based on data values (scaled)
DO J=1,10
DO I=1,INT(DATA(J)*10.0)
IF (I.LE.50) GRID(51-I,J) = '*'
ENDDO
ENDDO
! Print the grid
DO I=1,50
WRITE(*,10) (GRID(I,J), J=1,10)
10 FORMAT(10A1)
ENDDO
! Print x-axis labels
WRITE(*,20) (J, J=1,10)
20 FORMAT(10I1)
END
This program would output a simple vertical histogram using *
characters to represent the height of each bar, printed on a terminal or line printer. The output might look something like this:
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
1 2 3 4 5 6 7 8 9 0
Conclusion
Back in the day, creating graphs with limited resources like line printers and FORTRAN was a testament to the creativity and problem-solving skills of early programmers. They used text characters as pixels, scaled data manually, and sometimes relied on specialized hardware or manual adjustments to visualize data. While these methods seem primitive now, they laid the groundwork for modern data visualization techniques and demonstrated the importance of adapting to the tools at hand. If you’re curious about a specific type of graph or era of computing, I’d be happy to dive deeper!
Top comments (0)