필터 지우기
필터 지우기

Changing the colours in the legend in R2018a

조회 수: 1 (최근 30일)
Varun Wadia
Varun Wadia 2021년 1월 18일
댓글: Adam Danz 2021년 1월 27일
Hello!
I am plotting rasters and average firing rates for cells. To plot the average firing rates with the standard deviation I am using a function that plots the standard deviation using 'fill' with an alpha of 0.1, then plots the mean over it in a darker color (see plot). The legend seems to pick up the lighter color, making it very difficult to interpret when the number of classes gets beyond 2-3.
Is there a way to ensure that the legend picks up on the darker colors, perhaps manually?
I tried to assign the legend to the lower subplots but then it takes the first 12 dots (only 2 colors), which is even less helpful.
  댓글 수: 4
Varun Wadia
Varun Wadia 2021년 1월 27일
Ah I see, the issue was the order I was calculating the firing rates in (I needed to calculate mean first and then the std error, so the mean shows up on the legend). Thank you both!
Haha this data is in response to people watching videos involving those people!
Thank you both for the help!
Adam Danz
Adam Danz 2021년 1월 27일
Interesting! I wonder if subjects are equality familiar with the two.

댓글을 달려면 로그인하십시오.

채택된 답변

Varun Wadia
Varun Wadia 2021년 1월 27일
Copying the answer dpb gave in the comments so I can accept it.
"legend assigns the strings to the first handles in the axis in sequential order; if you want a different element titled, you need to save the handles to them and then pass that array to legend as the first parameter."

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by