RGB color value of plotyy purple bars

조회 수: 5 (최근 30일)
curoi
curoi 2015년 11월 18일
답변: Thorsten 2015년 11월 18일
I went to this page to determine how to overlay a line plot on top of a bar plot with multiple y-axes:
However, neither the site or use get( b, 'Color' ) gave me an answer. In fact after using:
[ ax, b, p ] = plot( x, y1, x, y2, 'bar', 'plot' );
get( b, 'Color' )
I only got the answer 'flat'. I like this particular color of purple and was just wondering what the RGB value is for it.

답변 (2개)

Walter Roberson
Walter Roberson 2015년 11월 18일
If you are referring to the color of the bars, then they are the first color in your colormap
cmap = colormap();
cmap(1,:)
On my system with the default colormap that is [0 0 .5625]

Thorsten
Thorsten 2015년 11월 18일
Try
get(b, 'EdgeColor')
get(b, 'FaceColor')
With Matlab R2012a, I get black bars and get [0 0 0] for EdgeColor and 'flat' for FaceColor.

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by