iplot
iplot
when we plot data, typically we use a fixed interval in the x-direction. as a result, if you try to use markers, in regions of your function where y is changing rapidly, the markers will be very spread out, and in regions where y barely changes, your markers will overlap. the result is a clumsy looking plot. you can try to get around this by plotting a subset of your function (i.e., plot(x(1:N:end),y(1:N:end)) but the result is also clumsy and you have to try and play around with N. this function solves this problem by guaranteeing that the distance between neighboring markers remains constant along the function you are plotting, regardless of its derivative direction. the user can specify the number of markers they want, N, spread evenly along the length of the plotted line. because the axis units does not always correspond to their displayed size in a plot, the user must also specify the x and y axis ranges they ultimately wish to display the plot at in xr=[xmin xmax] and yr=[ymin ymax].
example
x=linspace(-pi,pi,361)
y=sin(x);
figure(1)
iplot(x,y,[-pi pi],[-1 1],40,'k-s','LineWidth',0.75,'MarkerFaceColor','w','MarkerSize',5.0)
Cite As
Adam Glaser (2024). iplot (https://www.mathworks.com/matlabcentral/fileexchange/43229-iplot), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > 2-D and 3-D Plots >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |