# Library: PLplot

Homepage: PLplot, and its manual. In the manual, when a function is written plfoo, use it like pls->foo().

## Installation

• Windows: Sorry, gotta build from source.
• Linux: Find packages from your distribution, e.g., libplplot-dev
• Mac OS X: brew install plplot worked for me (let me know if you have an issue).

## Makefile

This works on Londo.

CXX=g++
CFLAGS=-Wall -g -I/usr/include/plplot -lplplotcxxd

all: main

main: main.o
$(CXX)$(CFLAGS) -o main main.o

main.o: main.cpp
$(CXX)$(CFLAGS) -c main.cpp

.PHONY: clean
clean:
rm -f main main.o

## Demo

The line delete pls actually calls pls->end() (or something like that) finally produces the plot and saves to the file.

If these two lines are missing in the code:

…then your program will start up asking you for the output device (screen, pdf, png, whatever). You can specify the output device on the command line:

./main -dev xwin

You can also see other command line options:

./main -h

This is all made possible by this line of code:

## Helper functions

Usage of the line function:

And another for histograms:

Usage of the histogram function: