![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/901885/image.png)
using a viridis colormap
조회 수: 337 (최근 30일)
이전 댓글 표시
Hello everyone,
I would like to know how is it possible to use properly a viridis colormap in order to draw scatter figures. For instance, i have this figure to plot :
figure(2)
plot(x1,y1,'^r','MarkerSize',8,'MarkerFaceColor','r')
% plot(x1,y1,'^r','MarkerSize',8,'MarkerFaceColor',viridis(5))
xlabel('F_{vis}')
ylabel('F_{flambement}','FontSize',13)
But I don't know how to use this "alternative" colormap since I am not familiar with this function in this case.
Could someone help please ?
Thank you in advance.
Sincerely.
댓글 수: 0
채택된 답변
Image Analyst
2022년 2월 21일
See attached demos where I show you how you can replace the default color order of plots and markers with some custom colormap of your own creation.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/901885/image.png)
댓글 수: 1
추가 답변 (2개)
DGM
2022년 2월 21일
편집: DGM
2022년 2월 21일
Use scatter() instead of plot(). The behavior of viridis() is otherwise the same as the built-in functions like jet().
N = 20;
x1 = randn(N,1);
y1 = randn(N,1);
scatter(x1,y1,50,viridis(N),'filled','^')
댓글 수: 5
Stephen23
2022년 2월 21일
@Wissem-Eddine KHATLA: you can also place it into the current directory, which may be easier.
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!