How to have smaller histogram show up on top of larger histogram

3 visualizaciones (últimos 30 días)
Allen Borrow
Allen Borrow el 21 de Feb. de 2022
Editada: Allen Borrow el 23 de Feb. de 2022
I have code that currently plots several histograms on the same figure, but when the first histogram created is smaller than the next one, it becomes completely covered. Is there a way to make it so that the smallest histogram always shows up in the foreground?

Respuestas (1)

Image Analyst
Image Analyst el 21 de Feb. de 2022
How are you plotting? Did you try
histogram(data1);
hold on;
grid on;
histogram(data2);
  3 comentarios
Jeff Miller
Jeff Miller el 22 de Feb. de 2022
maybe check the number of values in each dataset and plot the smallest one's histogram last?
Allen Borrow
Allen Borrow el 23 de Feb. de 2022
Editada: Allen Borrow el 23 de Feb. de 2022
That would work, but is there a way to make it so that no matter what order they are plotted in, the smallest one can still be on top? For the application I am using this code for, it would be helpful if order didn't matter

Iniciar sesión para comentar.

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by