# Can log scales be negative?

## Can log scales be negative?

Bottom line: A logarithmic axis can only plot positive values. There simply is no way to put negative values or zero on a logarithmic axis.

**How do you plot a log scale in Matlab?**

Create a vector of x-coordinates and two vectors of y-coordinates. Plot two lines by passing comma-separated x-y pairs to loglog . Alternatively, you can create the same plot with one x-y pair by specifying y as a matrix: loglog(x,[y1;y2]) .

### How do you plot zeros on a log scale?

The logarithm of zero is not defined — its mathematically impossible to plot zero on a log scale. Instead of entering zero, you can enter a low value (say -10 on the log scale), and then use custom ticks to label the graph correctly (so it is labeled “0” rather than “-10”.

**How do you log a negative number?**

Logarithms of negative numbers are not defined in the real numbers, in the same way that square roots of negative numbers aren’t defined in the real numbers. If you are expected to find the log of a negative number, an answer of “undefined” is sufficient in most cases.

## What is the difference between a [] and a {}?

[] is declaring an array. {} is declaring an object. An array has all the features of an object with additional features (you can think of an array like a sub-class of an object) where additional methods and capabilities are added in the Array sub-class.

**How do you plot a zero on a graph?**

To plot (0,0) , start at the origin (0,0) and move right 0 units and up 0 units.

### Is a logarithmic scale exponential?

A log scale is “growing exponentially” if its exponents (= order of magnitudes) are “growing linearly”.

**What is a negative log?**

What is a negative log? A negative log is defined as the number of times required that 1 must be divided by the base in order to achieve the log number. So, -Log2(. 5) = 1.

## What is the opposite of a logarithmic scale?

You can plot with exponential scaling, for example x=10x′. This is equivalent to plotting logbf(x) vs. x. To elaborate, consider a plot P to be defined by plot coordinates x′,y′ and a graph with points x,y. If you want x′ to be “shorter” for large x, i.e. stretch the axis, you’d set x=10x′ and thus y′=y=f(x)=f(10x′)