Why does ycolor also color the xaxis?
3 views (last 30 days)
Show older comments
Derek Neal on 1 Feb 2022
Edited: Derek Neal on 4 Feb 2022
After using plotyy, the ycolor command turns the left yaxis blue, right yaxis red and the xaxis red. I want xaxis to remain black. Using xcolor has no effect.
Dave B on 1 Feb 2022
With plotyy, you can use the output arguments to get access to the 'right' axes. Setting the property on gca would just affect the left axis (and I'd have expected an error with the syntax you provided):
Note that as you'll see on the plotyy documentation page, plotyy is not recommended, and we suggest you use yyaxis instead. Here is the equivalent code using yyaxis:
More Answers (0)
Find more on Two y-axis 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!