semilogx におけるグリッドラインについて
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
taiki kimura
am 26 Mai 2021
Kommentiert: taiki kimura
am 27 Mai 2021
clear all
set(0,'DefaultAxesXGrid','on');% 常に grid on
set(0,'DefaultAxesYGrid','on');% 常に grid on
set(0,'DefaultAxesGridLineStyle','-');
x = [125 250 500 1000];
y = [1 2 4 3 ];
semilogx(x,y,'*-');
xx = num2cell(x);
xticks(x)
xticklabels(xx)
以上を実行すると以下のグラフが出力されます.実線のグリッドラインは残し,点線のグリッドラインとその部分の目盛りを消去する方法を教えてください.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/631130/image.png)
0 Kommentare
Akzeptierte Antwort
Atsushi Ueno
am 26 Mai 2021
>実線のグリッドラインは残し,点線のグリッドラインとその部分の目盛りを消去する方法を教えてください.
% 実線のグリッドラインは残し
gca.XGrid = 'on'
gca.YGrid = 'on'
% 点線のグリッドラインを消去
gca.XMinorGrid = 'off'
gca.YMinorGrid = 'off'
% その部分の目盛りを消去
gca.XMinorTick = 'off'
gca.YMinorGrid = 'off'
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Grid Lines, Tick Values, and Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!