Scatterhist function not allowing for boxplot on the y-axis to stay
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi I'm trying to run a scatterhistogram (scatterhist()) but whenever I run the function the figure will pop up with the boxplot correctly displayed for a brief second on the y-axis and then disappear immediately. I'm not sure why. I also want to be able to color in the points and I'm not sure how to do that. Any help will be appreciated.
k = scatterhist(swine2, ready.rr_la, 'Group', swine);
hold on;
j = get(k(1),'colororder');
boxplot(k(3),ready.rr_la,swine2, 'Labels', {'10','11', '12', '13'}, 'color', j);
view(k(2),[270,90]);
xlabel('Subject');
ylabel('Err_la');
The figure displayed is atttached
5 comentarios
Adam Danz
el 23 de Oct. de 2020
That's helpful but it's not a "MWE" (something we can copy-paste and run on our end to reproduce the problem).
It looks like you're not specifying the axes. I'll add an answer but if it doesn't solve the problem you'll need to give a MWE.
Respuestas (1)
Adam Danz
el 23 de Oct. de 2020
Editada: Adam Danz
el 17 de Dic. de 2020
It looks like you're trying to add a boxplot to the y-historgram axes. Recall that the y-histogram in scatterhist is reversed. Also, you're rotating the scatter axes so that x and y are switched but the histograms aren't switched. Why not just switch x and y in the scatterhist function?
h = scatterhist(y,x,___);
To add a boxplot to the y-histogram axis,
hold(h(3), 'on')
boxplot(h(3), ___)
Use h(2) for the x-histogram or h(1) for the scatter axes.
4 comentarios
Adam Danz
el 27 de Oct. de 2020
I don't understand how your boxplots are supposed to map onto the histograms. But their x & y values need to be within range of the histogram's x & y values.
That will be very hard to do.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!