Label 0 in a semilog plot
Show older comments
Dear MatLab users,
I have some data I want to plot, and the x-axis values go from 0 to 1. However, I need to plot them in a semilog plot, and for obvious mathematical reasons I cannot plot the 0, despite being a value of my data. So my question is: can I somehow add a label on the plot or on the x axis? I attached a picture which shows two possible solutions (the left one would be ideal). Below is my code for the first part of the plot, but I am utterly clueless on how to do something like that in the picture. I can use XTickLabel and write 0 but I would like to leave that as a last resort.
x = [ 0.01 , 0.05 , 0.1 ] ; % My x axis. 0.01 in reality is 0.
a = [ rand(1) , rand(1) , rand(1) ] ; % My data
b = [ rand(1) , rand(1) , rand(1) ] ; % My data
figure
errorbar( x , a , b ,'o' , 'Color' , 'k' , 'MarkerSize' ,10 , 'Capsize' , 10 , 'linewidth' , 2 , 'MarkerEdgeColor','k','MarkerFaceColor','k' );
set(gca,'xscale','log')
axis([0.01 1 -2 2])
set(gca ,'Fontsize',20,'FontWeight','bold', 'Box','on')
set(gcf , 'color','w' , 'WindowState' , 'Maximize')
grid on
Accepted Answer
More Answers (0)
Categories
Find more on Errorbars in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
