How can I display axis ticks when using fill syntax?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Based on Figure 1, the axis ticks (bottom horizontal and right vertical) are hidden when using the fill syntax for my plot. Could you please help me display them again?
Figure 1:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1540602/image.jpeg)
0 Commenti
Risposta accettata
Star Strider
il 16 Nov 2023
Modificato: Star Strider
il 16 Nov 2023
The easiest way is to bring the ticks to the top layer —
x = linspace(0, 1).';
y = x;
figure
fill([x; flip(x)], [zeros(size(y)); flip(y)], 'g')
Ax = gca;
Ax.Layer = 'top';
Ax.Box = 'on';
Another option is to adjust the transparency ('FaceAlpha' value) of the patch.
.
EDIT — (16 Nov 2023 at 02:04)
Corrected typgraphical error.
.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!