I have a Matlab figure I want to use in a paper. This figure contains multiple cdfplots. Now the problem is that I cannot use the markers because the become very dense in the plot. If i want to make the samples sparse I have to drop some samples from the cdfplot which will result in a different cdfplot line.
How can I add enough markers while maintaining the actual line?
Add markers in one of these ways: Include a marker symbol in the line-specification input argument, such as plot(x,y,'-s') . Specify the Marker property as a name-value pair, such as plot(x,y,'Marker','s') .
Fill the markers with a shade of orange by setting the MarkerFaceColor property on the Line object. Then increase the marker size to 8 by setting the MarkerSize property. Change the outlines of the markers to match the fill color by setting the MarkerEdgeColor property.
One method is to get XData/YData properties from your curves follow solution (1) from @ephsmith and set it back. Here is an example for one curve.
y = evrnd(0,3,100,1); %# random data
%# original data
subplot(1,2,1)
h = cdfplot(y);
set(h,'Marker','*','MarkerSize',8,'MarkerEdgeColor','r','LineStyle','none')
%# reduced data
subplot(1,2,2)
h = cdfplot(y);
set(h,'Marker','*','MarkerSize',8,'MarkerEdgeColor','r','LineStyle','none')
xdata = get(h,'XData');
ydata = get(h,'YData');
set(h,'XData',xdata(1:5:end));
set(h,'YData',ydata(1:5:end));
Another method is to calculate empirical CDF separately using ECDF function, then reduce the results before plotting with PLOT.
y = evrnd(0,3,100,1); %# random data
[f, x] = ecdf(y);
%# original data
subplot(1,2,1)
plot(x,f,'*')
%# reduced data
subplot(1,2,2)
plot(x(1:5:end),f(1:5:end),'r*')
Result
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With