|
From: | Nicholas Jankowski |
Subject: | Re: Stacked bar plot with positive and negative values |
Date: | Mon, 20 Apr 2020 12:50:22 -0400 |
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,Tony
[Prev in Thread] | Current Thread | [Next in Thread] |