Linear versus logarithmic plots in 2D

Inherited | See below |

Objects | CoordinateType Default Values |
---|---|

`plot::CoordinateSystem2d` | `LinLin` |

`CoordinateType`

allows to switch between linear
and logarithmic 2D plots.

By default, a linear (Cartesian) scaling of all coordinate axes
is used in 2D. This corresponds to `CoordinateType = LinLin`

.
Logarithmic plots are created by choosing a `CoordinateType`

different
from `LinLin`

.

In 2D, the following coordinate types are available:

`LinLin`

: Straight lines given by*y*=*c*_{1}*x*+*c*_{2}are rendered as straight lines on the screen.`LinLog`

: Linear coordinates are plotted along the horizontal axis, logarithmic coordinates along the vertical axis. The curves are rendered as straight lines on the screen.`LogLin`

: Logarithmic coordinates are plotted along the horizontal axis, linear coordinates along the vertical axis. The curves*y*=*c*_{1}*ln*(*x*) +*c*_{2}are rendered as straight lines on the screen.`LogLog`

: Logarithmic coordinates are plotted along both axes. The curves*y*=*c*_{1}*x*^{c2}are rendered as straight lines on the screen.

The objects to be plotted must have strictly positive coordinate values in "logarithmic directions".

We consider an exponential function:

plot(plot::Function2d(5*exp(x/4), x = -10 .. 100), CoordinateType = LinLin):

In a singly logarithmic plot, the graph is a straight line:

plot(plot::Function2d(5*exp(x/4), x = 0 .. 100), CoordinateType = LinLog):

We render the function in a log-log plot:

plot(plot::Function2d(sqrt(x) + x^2, x = 10^(-3) .. 10^3), CoordinateType = LogLog):

Was this topic helpful?