How can I make the Nichols chart background grid more prominent when using Nicholsplot? (Too faint.)
Show older comments
Using a matlab example:
plotoptions = nicholsoptions;
plotoptions.GridColor = [0.0 0.0 0.0];
plotoptions.Grid = 'on';
H = tf([-4 48 -18 250 600],[1 30 282 525 60]);
nicholsplot(H, plotoptions);
Changing the color to black, as above, helps display the dottted nichols chart backgrounfd grid slighly better than the default, but it's still too faint. The default color is [0.15 0.15 0.15]. Is there another setting such as grid transparency (alpha ?) or bold option that would help enhance the grid's "presence" or more bold appearance on the plot?
Thanks.
Accepted Answer
More Answers (3)
You can change the linewidth of the grid lines
plotoptions = nicholsoptions;
plotoptions.GridColor = [0.0 0.0 0.0];
plotoptions.Grid = 'on';
H = tf([-4 48 -18 250 600],[1 30 282 525 60]);
Original plot
figure
N1 = nicholsplot(H, plotoptions);
Why is the -20 dB outside the axes? That looks very strange.
New plot
figure
N2 = nicholsplot(H, plotoptions);
N2.AxesStyle.GridLineWidth = 2;
But doing so changes the limits on the Open-Loop Gain axis?
Hi Charles,
Starting in R2024b, the nicholsplot function returns a chart object with a documented API. You can see the properties of the chart object here: https://www.mathworks.com/help/control/ref/controllib.chart.nicholsplot-properties.html
Specifically, you are interested in the AxesStyle property. You can change the GridColor and GridLineWidth from this property.
h = nicholsplot(tf([-4 48 -18 250 600],[1 30 282 525 60]));
h.AxesStyle.GridVisible = true;
h.AxesStyle.GridColor = [0 0 0];
h.AxesStyle.GridLineWidth = 2;
If you would like to download the R2025a prerelease, you can also change the GridLineStyle and hide/show the labels with GridLabelsVisible.
Unfortunately, there is no way to change the alpha value of the custom grid lines in a nichols chart. If you have not set the GridColor, there is some transparency applied to the grid lines, but that transparency is lost as soon as you manually specify a color.
Charles
on 5 Mar 2025
0 votes
Categories
Find more on 2-D and 3-D Plots 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!


