Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Is there a way to plot negative numbers on a log scale?

$
0
0

I know we are not supposed to be able to take the log of a negative number (or 0), but sometimes the scale is really useful.

using Plots
x = -10:0.01:10
y = x
plot(x, y)
plot(x, y, yaxis = log10.(y .+ 100))

image

It’s not what I thought would happen.

image

Do you have any suggestions on how to do this?

7 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles