How to change the stem line color

76 ビュー (過去 30 日間)
Daniel Carr
Daniel Carr 2016 年 4 月 27 日
コメント済み: Daniel Carr 2016 年 4 月 27 日
I am trying to do a stem plot with all the lines the same color. When I plot any of the examples from the website, all the lines have a gradient color on them, which makes my dataset confusing. I am using 2016a.
I have tried to change the color parameter of the data, but all this changes is the marker color. Please can someone direct me in the right direction as to how I can change this? I have included a picture of what my output looks like:
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 27 日
Can you post the code that gives this figure?
Daniel Carr
Daniel Carr 2016 年 4 月 27 日
figure(1)
stem(X1,Y1,'Marker','none','Color',[0 0.498039215803146 0]);
hold on
stem(X1(Y1>30),Y1(Y1>30),'Marker','none','Color',[1 0 0]);
hold off
This has been taken from an example online. Also I have the same issue when I run the examples from the website.

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2016 年 4 月 27 日
It may be perception rather than reality. Experimentally, increase the line width, and the lines look as they should:
figure(1)
stem(X1,Y1,'Marker','none','Color',[0 0.498039215803146 0], 'LineWidth',2);
hold on
stem(X1(Y1>30),Y1(Y1>30),'Marker','none','Color',[1 0 0], 'LineWidth',2);
hold off
  2 件のコメント
Daniel Carr
Daniel Carr 2016 年 4 月 27 日
Thank you, this seems like an annoying feature, but yes increasing the line width helps.
Star Strider
Star Strider 2016 年 4 月 27 日
My pleasure.
I didn’t see any problem with your code, so this was my first troubleshooting step.

サインインしてコメントする。

その他の回答 (1 件)

Mike Garrity
Mike Garrity 2016 年 4 月 27 日
That looks like the graphics driver bug which was discussed in this thread. Do you have an Intel GPU and Windows 10? My understanding is that the bug is limited to a particular Windows 10 driver version from Intel.
If that's the case, that thread has a couple of workarounds.
  1 件のコメント
Daniel Carr
Daniel Carr 2016 年 4 月 27 日
Ah I do have windows 10 with intel GPU. I will look into that and see what I can do

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by