# Plotting with log axis

**URL:** <https://discourse.julialang.org/t/plotting-with-log-axis/99599>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [May 30, 2023, 11:48am UTC](https://discourse.julialang.org/t/plotting-with-log-axis/99599 "2023-05-30T11:48:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Post date:** [May 30, 2023, 11:48am UTC](https://discourse.julialang.org/t/plotting-with-log-axis/99599/1 "2023-05-30T11:48:13Z")

</div>

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?

```julia
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)

```

---

<div class="post-metadata">

**Author:** ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Post date:** [May 30, 2023, 11:56am UTC](https://discourse.julialang.org/t/plotting-with-log-axis/99599/2 "2023-05-30T11:56:15Z")

</div>

I got the solution.

```julia
plot(x, y, xaxis = (:log10, [10^-4, :auto]))

```

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [May 30, 2023, 1:20pm UTC](https://discourse.julialang.org/t/plotting-with-log-axis/99599/3 "2023-05-30T13:20:40Z")

</div>

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.
