I have this code. Im trying to plot log x-axis but it doesn’t show anything and gives warning as below. I know its coming because of 0 at starting point and its log on x axis but how can i avoid and plot?
x = zeros(12)
for i in 2:12
x[i] = big(10)^i * big(10)^-6
end
y = [0, 0.1, 0.1, 0.34, 0.5, 0.7, 0.72, 0.78, 0.8, 0.83, 0.83, 0.83]
plot(x, y, xaxis = :log10)
I got the solution.
plot(x, y, xaxis = (:log10, [10^-4, :auto]))
For the future, please make sure your example runs as-is (mention which package you get plot()
from, specifically), and mention the error message.
Mathematically, you cannot plot a zero on a log graph, so there is a fundamental problem with trying to plot that specific vector. It’s likely something is wrong in whatever principle you’re trying to illustrate.