Bars disappear with log scale
Ältere Kommentare anzeigen
Executing the following four commands
Y = count(1:10,:);
figure
bar3h(Y,'grouped')
set(gca,'YScale','log')
gives me the plot without the bars? how could I restore the body of each bar?
Thanks for any help
1 Kommentar
Adam Danz
am 1 Jun. 2021
@wael Ghareeb Welcome to the forum. I've edited your question to format your code. In the future please use the code/text toggle in rich text editor to format your code.
Akzeptierte Antwort
Weitere Antworten (1)
While not ideal this should get you by since bar tries to plot the bar all the way to 0 which log scales don't show
y=randi(100,10,10);
figure(1),clf
hbar = bar3h(y,'grouped')
set(gca,'Yscale','log')
minY2plt = 0.001;
for ind = 1:10
hbar(ind).YData(hbar(ind).YData==0)=minY2plt;
end
ylim([minY2plt max(y(:))])
1 Kommentar
wael Ghareeb
am 1 Jun. 2021
Kategorien
Mehr zu Log Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


