Changing the opacity of a fit line

2 次查看(过去 30 天)
I'm trying to get my fit line to be the same opacity as the scatter points. How can I convert the line color from the way that I have it to the 4D color i.e [0 0 0 0.5] ?
scatter(TDSad.Agemos,TDSad.(measureToAnalyze),'k','v','MarkerEdgeAlpha',0.5)%
scatter(DSSad.Agemos,DSSad.(measureToAnalyze),'m','^','filled')%
[sortedTD, sortItd] = sort(TDSad.Agemos);
p1 = plot(sortedTD,TDall_yfit(sortItd),'LineStyle','--','Color','k','LineWidth', 2,);
p2 = plot(DSSad.Agemos,DSall_yfit,'LineStyle','-','Color','m','LineWidth',2);
  1 个评论
Mathieu NOE
Mathieu NOE 2021-4-2
hello
exactly the sme way as for scatter : , like
p1 = plot(1:10,1:10,'LineStyle','--','Color',[0 0 0 0.5])

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by