# Plot padding when \`showaxis\` false

**URL:** <https://discourse.julialang.org/t/plot-padding-when-showaxis-false/37716>\
**Category:** Visualization\
**Created:** [April 16, 2020, 9:28pm UTC](https://discourse.julialang.org/t/plot-padding-when-showaxis-false/37716 "2020-04-16T21:28:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chriswaudby](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chriswaudby/32/26574_2.png) [@chriswaudby](https://discourse.julialang.org/u/chriswaudby)\
**Post date:** [April 16, 2020, 9:28pm UTC](https://discourse.julialang.org/t/plot-padding-when-showaxis-false/37716/1 "2020-04-16T21:28:13Z")

</div>

I would like to make some plots where the y axis is not shown. I can do this by setting `yshowaxis=false`, but there is then ugly excess padding on the left of the figure.

For example:

```julia
using Plots
y=[1,1000000]
plot(y,yshowaxis=false,yticks=[0,1000000])

```

It seems that the axis is being created and then made invisible, rather than the plot area being calculated correctly in the first instance. Is there any workaround to this behaviour?

---

<div class="post-metadata">

**Author:** ![josephmarturano](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@josephmarturano](https://discourse.julialang.org/u/josephmarturano)\
**Post date:** [April 17, 2020, 1:16pm UTC](https://discourse.julialang.org/t/plot-padding-when-showaxis-false/37716/2 "2020-04-17T13:16:07Z")

</div>

One idea would be to set the yticks to `nothing`, like this:

```julia
using Plots
gr()
y=[1,1000000]
testplot = plot(y,yshowaxis=false,yticks=nothing, size=(1000,800))
savefig(testplot, "noticks.png")

```

Which produces the following:

 ![noticks](https://global.discourse-cdn.com/julialang/original/3X/6/a/6a26028f95460b12f48dd10614c18421e77c096f.png)

---

<div class="post-metadata">

**Author:** ![chriswaudby](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chriswaudby/32/26574_2.png) [@chriswaudby](https://discourse.julialang.org/u/chriswaudby)\
**Post date:** [April 18, 2020, 12:01am UTC](https://discourse.julialang.org/t/plot-padding-when-showaxis-false/37716/3 "2020-04-18T00:01:58Z")

</div>

OK, that definitely helps, thanks very much.

By the way, just noticing in this simple example - the x axis scale is very weird, is this a bug?
