transparent grey bar on graphs
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I would like to draw a grey bar to emphasize when the signals were triggered like in the picture. Should I use patch function as it will be loop.
thanks for suggestion
.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1114035/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1114035/image.png)
0 commentaires
Réponse acceptée
Cris LaPierre
le 1 Sep 2022
Modifié(e) : Cris LaPierre
le 1 Sep 2022
x=0:.1:5;
y=(x-2).^3;
patch([0 5 5 0],[0 0 4 4],[.75 .75 .75])
hold on
plot(y,x,'LineWidth',2)
hold off
If you do prefer to have a transparent bar, then adjust the FaceAlpha property. Just note that this will also cause a slight change in the color of the patch.
x=0:.1:5;
y=(x-2).^3;
plot(y,x,'LineWidth',2)
patch([0 5 5 0],[0 0 4 4],[.75 .75 .75],'FaceAlpha',0.25,'EdgeColor','none')
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Polygons dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!