Set ylims in marginplot

How do I set y limits for marginplot (or bodeplot)? ylims just sets the limits for both the margin and the phase the same, which is rarely helpful. There is ylimsphase, which only works for bodeplot, not marginplot, and doesn’t seem to do anything (it’s commented out in the code).
Is there a way to adjust the limits after plotting?

Minimal working example (has infinite margin, so marginplot is no different from bodeplot, but that’s not what I have trouble with anyway):

using Plots
using ControlSystemsBase
s=tf('s')
marginplot(1/(s+10))
title!("")

nevermind, I found it, e.g.:

using Plots
using ControlSystemsBase
s=tf('s')
p1=marginplot(1/(s+10))
ylims!(p1.subplots[2], (-200, -150))
title!("")

You can also pass a 1 x 2 row of tuples

marginplot(1/(s+10), ylims=[(1e-2, 1) (-120, 0)])

Using two columns is Plots.jl syntax to control the two distinct series (magnitude is the first, phase the second), this mirrors the fact that one can plot two series by passing an N x 2 matrix with two columns.

1 Like

that’s better, thanks!