![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/367636/image.png)
Overlaying Histogram plot along a vurve
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Arash
el 28 de Sept. de 2020
Comentada: Ameer Hamza
el 28 de Sept. de 2020
HI, I have a curve in my plot and I want to add Histograms to different position of the curve as shown in the figure. I was wondering if this is possible? I appreciate any help.
Thanks
Thanks ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/367609/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/367609/image.jpeg)
0 comentarios
Respuesta aceptada
Ameer Hamza
el 28 de Sept. de 2020
Here is an example
f = figure;
ax = axes();
x = linspace(0, 3, 100);
y = exp(-x);
plot(x, y);
ax1 = axes('Position', [0.25 0.7 0.2 0.2]); % these are figure coordinates
box(ax1);
histogram(ax1, rand(10));
ax1.View = [90 90]; % rotate the axes
ax2 = axes('Position', [0.43 0.43 0.2 0.2]); % these are figure coordinates
box(ax2);
histogram(ax2, rand(10));
ax2.View = [90 90]; % rotate the axes
ax3 = axes('Position', [0.71 0.24 0.17 0.2]); % these are figure coordinates
box(ax3);
histogram(ax3, rand(10));
ax3.View = [90 90]; % rotate the axes
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/367636/image.png)
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Histograms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!