The PLplot Plotting Library: Programmer's Reference Manual
Prev | Chapter 2. Simple Use of PLplot | Next

# Defining Plot Scales and Axes

The function `plenv` is used to define the scales and axes for simple graphs. `plenv` starts a new picture on the next subpage (or a new page if necessary), and defines the ranges of the variables required. The routine will also draw a box, axes, and numeric labels if requested. The syntax for `plenv` is:

`plenv` (xmin, xmax, ymin, ymax, just, axis);

`xmin, xmax` (`PLFLT`, input) The left and right limits for the horizontal axis. `ymin, ymax` (`PLFLT`, input) The bottom and top limits for the vertical axis. `just` (`PLINT`, input) This should be zero or one. If `just` is one, the scales of the x-axis and y-axis will be the same (in units per millimeter); otherwise the axes are scaled independently. This parameter is useful for ensuring that objects such as circles have the correct aspect ratio in the final plot. `axis` (`PLINT`, input) `axis` controls whether a box, tick marks, labels, axes, and/or a grid are drawn. `axis` = -2: No box or annotation. `axis` = -1: Draw box only. `axis` = 0: Draw box, labeled with coordinate values around edge. `axis` = 1: In addition to box and labels, draw the two axes X = 0 and Y = 0. `axis` = 2: Same as `axis` = 1, but also draw a grid at the major tick interval. `axis` = 10: Logarithmic X axis, linear Y axis. `axis` = 11: Logarithmic X axis, linear Y axis and draw line Y = 0. `axis` = 20: Linear X axis, logarithmic Y axis. `axis` = 21: Linear X axis, logarithmic Y axis and draw line X = 0. `axis` = 30: Logarithmic X and Y axes.

Note: Logarithmic axes only affect the appearance of the axes and their labels, so it is up to the user to compute the logarithms prior to passing them to `plenv` and any of the other routines. Thus, if a graph has a 3-cycle logarithmic axis from 1 to 1000, we need to set `xmin` = `log10`(1) = 0.0, and `xmax` = `log10`(1000) = 3.0.

For greater control over the size of the plots, axis labeling and tick intervals, more complex graphs should make use of the functions `plvpor`, `plvasp`, `plvpas`, `plwind`, `plbox`, and routines for manipulating axis labeling `plgxax` through `plszax`.

Prev | Home | Next
Initializing PLplot | Up | Labeling the Graph