How to add Cartesian grid in pzplot plot ?
Show older comments
Is there any option to add Cartesian Grid in pzplot(sys) ?
I tried by adding following code
s = tf('s');
sys = (s+2.5)*(s-2)/(s+5)/(s+8-2i);
figure;
ax = gca;
ax.XGrid = 'on';
ax.YGrid = 'on';
h = pzplot(ax, sys);
p = getoptions(h);
p.XLim = {[-10, 4]};
p.YLim = {[-2.5, 2.5]};
setoptions(h, p);
but it did'n change plot generated by pzplot
when I add p.XGrid = 'on'; p.YGrid = 'on', it only shows zeta-wn grid.
PS : I was able to add Cartesian Grid by editing Edit -> Figure Properties but I wanted to do this by Code
Accepted Answer
More Answers (1)
You can do this directly from the pzplot chart object starting in R2026a.
h = pzplot(rss(3)); %Create chart
h.AxesStyle.GridVisible = "on"; %Enable grid
h.AxesStyle.GridType = "cartesian"; %Switch to cartesian grid
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!