Errorbar: Thicker line but same error bar width

13 ビュー (過去 30 日間)
Sepp
Sepp 2014 年 12 月 2 日
編集済み: Sepp 2014 年 12 月 3 日
Hi
I have made a plot with some errorbars, i.e. my code looks as follows:
figure;
box on
hold on
errorbar(x, jobsInQueue, stdJobsInQueue, '--k.');
h = errorbar(x, jobsInService, stdJobsInService, ':k+');
set(get(h,'Children'),{'LineWidth'},{2; 1})
errorbar(x, jobsInSystem, stdJobsInSystem, '-k.');
hold off
Now I want the second error bar to have a thicker line but without a thicker error bar. I tried it above with the set method using the handler h but it does not work.
How can I do it?

採用された回答

Thorsten
Thorsten 2014 年 12 月 2 日
編集済み: Thorsten 2014 年 12 月 2 日
Just plot a thicker line on top:
hold on
plot(x, jobsInSystem, '-k.', 'LineWidth', 2)

その他の回答 (1 件)

Sepp
Sepp 2014 年 12 月 3 日
編集済み: Sepp 2014 年 12 月 3 日
Thanks but I had to do it in this way otherwise the legend was not adapted.
figure;
box on
hold on
errorbar(x, jobsInQueue, stdJobsInQueue, '--k.');
plot(x, jobsInService, ':k.', 'LineWidth', 2)
errorbar(x, jobsInSystem, stdJobsInSystem, '-k.');
errorbar(x, jobsInService, stdJobsInService, ':k.');
hold off

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by