Specifying the colour of a scatter plot
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am trying to plot a scatterplot but I want the colours to be .. specific.
I am using this function:
scatter (x, y, 'filled', 'MarkerEdgeColor',[.255, .66, 0], 'MarkerFaceColor',[.255, .66, 0]);
as I found this to be the correct command online but the colour that I get is not what I think I specify... the colour I need in RGB is 255 66 0 and the one that is being plotted here is some weird green.. do you have any ideas what could be wrong ?
Another thing: I wanted to remove the numbers from the y-axis and put labels on them. For example -2 would be disagree, -1 would be slightly disagree, -0.03 would be just slightly disagree and 0.03 would be just slightly agree... etc. Because the distances between these points isn't the same I am having a hard time specifying this in Matlab, do you know how to go about this?
0 个评论
采纳的回答
Shubham Gupta
2019-9-30
编辑:Shubham Gupta
2019-9-30
Try:
scatter (x, y, 'filled', 'MarkerEdgeColor',[255, 66, 0]/255, 'MarkerFaceColor',[255, 66, 0]/255);
to change tick labels for y-axis:
a = gca;
a.YTick = [-2,-1,-0.03,0.03,1,2];
a.YTickLabel = {'Label1','Label2','Label3','Label4','Label5','Label6'}';
I hope it helps !
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!