フィルターのクリア

transparent line plot markerfacealpha

66 ビュー (過去 30 日間)
Lieke Numan
Lieke Numan 2019 年 3 月 21 日
回答済み: Abhishek Singh 2019 年 3 月 25 日
I want to plot my data with a coloured background, which need to be seen through the points. Therefore I want to have transparent lines.
I use a code similarly to this:
x=1:10
y=[10 29 38 7 6 4 83 7 29 10]
figure
p1=plot(x,y,'.')
p1.MarkerFaceAlpha=0.2
p1.MarkerEdgeAlpha=0.2
I get this error:
Unrecognized property 'MarkerFaceAlpha' for class 'matlab.graphics.chart.primitive.Line'.
Unrecognized property 'MarkerEdgeAlpha' for class 'matlab.graphics.chart.primitive.Line'.
Does anyone know how to deal with this?

回答 (1 件)

Abhishek Singh
Abhishek Singh 2019 年 3 月 25 日
It is because you’re trying to use the MarkerFaceAlpha property in Plot function, but this property is the part of scatter chart rather than plot function.
Just change the line
p1=plot(x,y,'.')
to
p1=scatter(x,y,'.')
And this should not produce any error

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by