matlab 画图怎么把坐标轴的名称字体颜色

2025-03-29 13:09:08
推荐回答(1个)
回答1:

clc; clear; close all;

x = 0:2:8;
y = x.^2;
plot(x,y);
axis([0 8 -inf inf]);
set(gca,'XTick', 0:8);
set(gca,'XTickLabel',{'a=0', '', 'b=2', '', 'c=4', '', 'd=6', '', 'e=8'}, 'FontName','Arial', 'FontSize',20, 'XColor',[1 0 0]);