Using a logarithmic scale

In all the previous discussion we have used linear scales. Another option is to
use a logarithmic scale. This is often used when there is a need to display both
very small and very large values in the same graph. The library supports the use of
logarithmic scales on both the x- and y-axis (as well as the optional extra
y-axis).

The logarithmic scale support is defined in the module file
"jpgraph_log.php" so this must be included in order to
access this feature.

Tip

If you think the first value of the Y-axis is to close to the first label
of the X-axis you have the option of either increasing the margin (with a
call to SetLabelMargin() ) or to hide the first label (with a
call to Axis::HideFirstTickLabel() )

As a final example of using a logarithmic scale we show how to combine a text
scale for the x-axis and a logarithmic scale for the y-axis. As we already shown in
Graphing the number of sun spots during the 19th Century it is possible to manually specify
the labels that should be used on the axis with a call to Axis::SetTickLabels().
Let's make use of this and the built-in library super global variable
"$gDateLocale" which is an instance of a date utility class to get
a list of the name of all the months in a localized fashion.

To use the name of the months on the x-axis we haev to add the following two lines
to the previous example