matlab in a plot use annotation for diamond
조회 수: 45 (최근 30일)
이전 댓글 표시
i'm kind of a newbie in matlab, hope that someone can help me!
I'm doing several plots, using "hold on", with different markers and colors in a cycle. I would like to create a legend for the plot. The problem is that not always all the plots will be created, as sometimes the vector will be null, and therefore "legend" is not a good option.
I was thinking to use annotation, but i don't know how to represent the symbols like "Diamond" or "Left-pointing triangle", with colors and filled, using the annotation
For example: how to write this in the form of annotation??
'marker','d','markerfacecolor',[0 1 0],'LineStyle','none','color',rgb('lime')
댓글 수: 0
답변 (1개)
Chad Greene
2016년 1월 17일
Check out the LineSpec table here. Use plot(x,y,'d') for diamond or plot(x,y,'<') for left-pointing triangle. Include 'markerfacecolor' to fill the marker. For example,
plot(x,y,'d','color','r','markerfacecolor','b','markersize',12)
prints a big blue diamond with a red outline.
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!