plotting positive values blue and negative values red of a grouped bar plot

11 ビュー (過去 30 日間)
Poulomi Ganguli
Poulomi Ganguli 2018 年 1 月 19 日
コメント済み: Poulomi Ganguli 2018 年 1 月 21 日
Hello,
I have a dissimilar length of data: one 18x1 and the other 72x1 and I want to plot a horizontal grouped bar plot of my data. data values range from positive and negative values. I have tried foll. way to plot, however, not sure how to show positive part as red and negative part as blue.
L_x = length(x);
L_y = length(y);
h = nan(max(L_x,L_y),2)
h(1:L_x,1) = x;
h(1:L_y,2) = y;
H = h';
Z = [1,2]
barh(Z,H,'grouped');
set(gca, 'CLim', [-30 30]);
  1 件のコメント
Poulomi Ganguli
Poulomi Ganguli 2018 年 1 月 21 日
I solved the problem by superimposing negative & positive part of data together.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeColor and Styling についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by