poster
2019-11-25, 00:00
<p>I have the following problem with the scatterhist-function in Matlab:</p>
<p>data is a 1000x49 matrix.
prediction is a 1000x1 vector, with each cell as a integer-value in range 0-3</p>
<p>I expected the following to produce two scatterhist-Plots of the same data but with different subgroups (2,1) colored orange. So both Y-Axis-Histograms should display the same distribution (when the groups are summed up)</p>
<p><code>scatterhist(data(:,43),data(:,49),'Group',prediction==2,'Kernel','on','Marker','.');</code></p>
<p><a href="https://i.stack.imgur.com/O52yS.png" rel="nofollow noreferrer">Plot 1</a></p>
<p><code>scatterhist(data(:,43),data(:,49),'Group',prediction==1,'Kernel','on','Marker','.');</code></p>
<p><a href="https://i.stack.imgur.com/jDyrn.png" rel="nofollow noreferrer">Plot 2</a></p>
<p><strong>Now my question is:</strong></p>
<ul>
<li>Do the Histograms in both plots not add up to the same total? (and my logic is flawed)</li>
<li>or do the groups not share the same axis? </li>
</ul>
More... (https://stackoverflow.com/questions/59019368/how-to-ensure-common-histogram-axis-among-all-groups-in-scatterhist-in-matlab)
<p>data is a 1000x49 matrix.
prediction is a 1000x1 vector, with each cell as a integer-value in range 0-3</p>
<p>I expected the following to produce two scatterhist-Plots of the same data but with different subgroups (2,1) colored orange. So both Y-Axis-Histograms should display the same distribution (when the groups are summed up)</p>
<p><code>scatterhist(data(:,43),data(:,49),'Group',prediction==2,'Kernel','on','Marker','.');</code></p>
<p><a href="https://i.stack.imgur.com/O52yS.png" rel="nofollow noreferrer">Plot 1</a></p>
<p><code>scatterhist(data(:,43),data(:,49),'Group',prediction==1,'Kernel','on','Marker','.');</code></p>
<p><a href="https://i.stack.imgur.com/jDyrn.png" rel="nofollow noreferrer">Plot 2</a></p>
<p><strong>Now my question is:</strong></p>
<ul>
<li>Do the Histograms in both plots not add up to the same total? (and my logic is flawed)</li>
<li>or do the groups not share the same axis? </li>
</ul>
More... (https://stackoverflow.com/questions/59019368/how-to-ensure-common-histogram-axis-among-all-groups-in-scatterhist-in-matlab)