|
From: | Tony Richardson |
Subject: | Re: Stacked bar plot with positive and negative values |
Date: | Mon, 20 Apr 2020 11:54:53 -0500 |
Hi Olivier,Octave's stacked option appears to work differently than Excel. I prefer Octave's behavior (although it would be considered a bugif it differs from MATLAB, I don't have MATLAB to check). It appears that you can get the plot you want by plotting the positiveand negative values separately:z=[1 -2 3; 4 3 1]
zt = z;
zt(zt<0) = 0
h = bar (zt, 'stacked');
hold on
zt = z;
zt(zt>0) = 0
h = bar (zt, 'stacked');
hold offTonyFYI. Octave's behavior is consistent with MATLAB's,Tonyonly for your code. his original code does produce different results in Matlab and Octave.
[Prev in Thread] | Current Thread | [Next in Thread] |