# Decade missing in bode plot

**URL:** <https://discourse.julialang.org/t/decade-missing-in-bode-plot/89564>\
**Category:** Modelling & Simulations\
**Tags:** plots, controlsystems\
**Created:** [October 31, 2022, 2:21pm UTC](https://discourse.julialang.org/t/decade-missing-in-bode-plot/89564 "2022-10-31T14:21:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucasmsoares96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucasmsoares96/32/38743_2.png) [@lucasmsoares96](https://discourse.julialang.org/u/lucasmsoares96)\
**Post date:** [October 31, 2022, 2:21pm UTC](https://discourse.julialang.org/t/decade-missing-in-bode-plot/89564/1 "2022-10-31T14:21:42Z")

</div>

When I plot the bode diagram it hides the decade `10¹`

```julia
begin
	using ControlSystems
	using Plots
	h₁ = tf(
		[10],
		[1, 20]
	)
	bodeplot(h₁)
end

```

 ![Captura de Tela 2022-10-31 às 10.39.49](https://global.discourse-cdn.com/julialang/original/3X/3/1/31a84fa36c9682d7a62ba5b865d697354fd9869b.png)

How to show the missing decade?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [October 31, 2022, 2:34pm UTC](https://discourse.julialang.org/t/decade-missing-in-bode-plot/89564/2 "2022-10-31T14:34:47Z")

</div>

The `xticks` are autogenerated, but you can always pass your own: `xticks = [1, 10, 100]`

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 31, 2022, 2:44pm UTC](https://discourse.julialang.org/t/decade-missing-in-bode-plot/89564/3 "2022-10-31T14:44:10Z")

</div>

You could fix first the common frequency axis, and then the individual subplots y-axes (better to use both `ticks` and `lims` keywords for more general case):

```julia
bodeplot(h₁, xticks=10.0.^(0:3), xlims=(1, 10^3))
plot!(yticks=10.0.^(-2:0), ylims=(10^-2,1), subplot=1)
plot!(yticks=-90:30:0, ylims=(-90,0), subplot=2)

```

 ![ControlSystems_bode_plot_decades](https://global.discourse-cdn.com/julialang/original/3X/d/0/d085cd71e5f60a23e023a4cce89bd9f014396af9.png)

---

<div class="post-metadata">

**Author:** ![lucasmsoares96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucasmsoares96/32/38743_2.png) [@lucasmsoares96](https://discourse.julialang.org/u/lucasmsoares96)\
**Post date:** [October 31, 2022, 6:22pm UTC](https://discourse.julialang.org/t/decade-missing-in-bode-plot/89564/4 "2022-10-31T18:22:35Z")

</div>

according to baggepinnen in:

> <https://github.com/JuliaControl/ControlSystems.jl/issues/765#issuecomment-1297218936>
>
> When I plot the goat diagram it hides the decade \`10¹\`
> \`\`\`julia
> begin
> using …ControlSystems
> using Plots
> h₁ = tf(
> \[10\],
> \[1, 20\]
> )
> bodeplot(h₁)
> end
> \`\`\`
> !\[Captura de Tela 2022-10-31 às 10.39.49|690x450\](upload://9f0MgNYhKB3nHSf8zQvcjmtHh0i.png)

This is up to the plotting backend to select, if you plot with GR (the default backend), it does indeed look like they do not display the 1e1 tick

1. Choose another backend, e.g. `plotly()` or
2. Manually specify the ticks using keyword argument `xticks = ` , e.g., `bodeplot(h₁, xticks=exp10.(0:0.5:3))`
