Alternative Error Histogram Plot ?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Aladin Djuhera
el 7 de En. de 2020
Comentada: Aladin Djuhera
el 22 de Feb. de 2020
Hi guys!
I'd like to plot an error histogram for my thesis, however the function ploterrhist cannot be used in a subplot which is very strange. I'd like to obtain the same or similar result including the x-axis and y-axis labeling and most importantly the x-axis scale as shown in the following picture.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/260326/image.png)
Can anyone help ? Thank you !
1 comentario
dpb
el 8 de En. de 2020
I see nothing unique about ploterrhist and a normal histogram other than it pre-labels the axes and title for you. That shouldn't be hard to figure out... :)
I don't have the TB so can't test (actually, have lost access at least temporarily so can't even demonstrate) but the only reason I can see why there should be any issue with it and subplot might be that it has a call to figure buried inside it.
Try
edit ploterrhist
and see...you could simply comment it out temporarily if that's the culprit.
Respuesta aceptada
Samatha Aleti
el 20 de Feb. de 2020
Hi,
“ploterrhist” does not support a parent axes argument. However, as a workaround, after using “ploterrhist”, you could reparent its axes using “gca” into a “tiledlayout” (from R2019b+). “tiledlayout" is intended as a “subplot” replacement, and lets you complete the workflow above. Here is a sample code:
figure();
t = tiledlayout(2, 1);
figure();
ploterrhist(e,'bins',30);
ax = gca;
H = findobj('type','legend');
ax.Parent = t;
H.Parent = t;
figure();
ploterrhist(e,'bins',10);
ax = gca;
ax.Parent = t;
ax.Layout.Tile = 2;
This is applicable for releases R2019b and above.
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Distribution Plots 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!