MATLAB: Equally spaced markers in a loglog plot

loglogmarkersplottingspacing

Hello,
I have the following problem: I am plotting a line in a loglog plot. However since the figure will be printed in black&white I want additional markers to be on the line. Is there a simple way to have the makers equally spaced in the loglog scale. The way I am doing it right now is:
x=linspace(1000,10000,1000);
data=x.^-0.5;
loglog(x,data)
hold on
scatter(x(1:100:end),data(1:100:end));
But obviously this makes the marker not equally spaced. I could make a function for 'data' and than feed it with the right values,like this:
xx=(10*ones(1,11)).^(3:0.1:4);
data_fun=@(a) a.^-0.5;
figure()
loglog(x,data)
hold on
scatter(xx,data_fun(xx));
but I was wondering if there is a simpler way, since that would mean creating a lot of functions (in my case). Thx Vali

Best Answer

x=linspace(1000,10000,1000);
data=x.^-0.5;
loglog(x,data)
hold on
evenMarkers(x,data,11);
where evenMarkers is this function:
function [xmarkers,ymarkers,h] = evenMarkers(x,y,NumMarkers)
xmarkers = logspace(log10(x(1)),log10(x(end)),NumMarkers);
ymarkers = interp1(x,y,xmarkers);
h = plot(xmarkers,ymarkers,'ko');
end