How do I restrict my data that needs to be plotted?
Show older comments
I have the following code:
xrayslice = 'projection0000.tif';
A = imread(xrayslice, 1);
C = A(60,:);
plot(C)
axis([200,300,0,40000])
xlabel('Pixel');
ylabel('Counts');
title('Projection of X-Ray slice');
Which produces a plot that I want, but only because the axis are restricted. How would I go about producing the same graph but by restricting my data, not my axis? I need my x values to be plotted between 200 and 300 and my y values to be plotted between 0 and 40000. I have tried using
if C<40000
plot(C)
end
but this doesn't work. Any helps or tips would be appreciated. Thank you!
Answers (2)
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!