comparison scripts/plot/draw/private/__bar__.m @ 18810:d99475e26c78 stable

Fix regression in width of bars for hist() (bug #42401). * __bar__.m: For 'hist' styles with only a single bar, set group width to 1 so that bars will touch.
author Rik <rik@octave.org>
date Fri, 23 May 2014 13:04:57 -0700
parents d63878346099
children f96495e88a70
comparison
equal deleted inserted replaced
18809:ac0c04e4d141 18810:d99475e26c78
118 error ("%s: X vector values must be in ascending order", func); 118 error ("%s: X vector values must be in ascending order", func);
119 endif 119 endif
120 120
121 nbars = columns (y); 121 nbars = columns (y);
122 122
123 ## Column width is 1 for 'hist*' styles. Otherwise, same as group width. 123 ## Column width is 1 for 'hist*' styles (bars touch).
124 if (nbars == 1) 124 if (islogical (histc))
125 cwidth = 1;
126 if (nbars == 1)
127 gwidth = 1;
128 else
129 gwidth = width^2;
130 endif
131 elseif (nbars == 1)
125 cwidth = 1; 132 cwidth = 1;
126 gwidth = width; 133 gwidth = width;
127 elseif (islogical (histc))
128 cwidth = 1;
129 gwidth = width^2;
130 else 134 else
131 cwidth = gwidth = width; 135 cwidth = gwidth = width;
132 endif 136 endif
133 137
134 ## Complicated algorithm sizes bars with unitless parameter width. 138 ## Complicated algorithm sizes bars with unitless parameter width.