Jason
2012-03-05 17:25:12 UTC
Is there a way to add markers to a contour plot, or alternatively, to easily save a particular contour level as an XY data set and plot it using plot()?
What I am trying to do is:
figure
contour(X1, Y1, Z1, contour_level, '-k');
hold on
contour(X1(1:3:end), Y1(1:3:end), Z1(1:3:end,1:3:end), contour_level, '^k');
contour(X2, Y2, Z2, contour_level, '-r');
contour(X2(1:3:end), Y2(1:3:end), Z2(1:3:end,1:3:end), contour_level, 'or');
contour(X3, Y3, Z3, contour_level, '-b');
hold off
The intention is to plot 3 contours on top of one another and differentiate them with markers and colour (so that the lines may still be differentiated if printed in B&W). Simply changing the linestyles does not change their visual appears enough.
There are two problems with the above method:
(1) Marker calls are disabled for contour().
(2) When plotting the undersampled contours (e.g. X1(1:3:end)), which was originally intended to put one marker per every 3 data points on a line, it actually recalculates the contours and shifts them (presumably because the contour is different for the undersampled case).
Is there any easy work-around and/or an simple way to just save my contours into an XY format so that I can plot them with plot()?
Thank you.
What I am trying to do is:
figure
contour(X1, Y1, Z1, contour_level, '-k');
hold on
contour(X1(1:3:end), Y1(1:3:end), Z1(1:3:end,1:3:end), contour_level, '^k');
contour(X2, Y2, Z2, contour_level, '-r');
contour(X2(1:3:end), Y2(1:3:end), Z2(1:3:end,1:3:end), contour_level, 'or');
contour(X3, Y3, Z3, contour_level, '-b');
hold off
The intention is to plot 3 contours on top of one another and differentiate them with markers and colour (so that the lines may still be differentiated if printed in B&W). Simply changing the linestyles does not change their visual appears enough.
There are two problems with the above method:
(1) Marker calls are disabled for contour().
(2) When plotting the undersampled contours (e.g. X1(1:3:end)), which was originally intended to put one marker per every 3 data points on a line, it actually recalculates the contours and shifts them (presumably because the contour is different for the undersampled case).
Is there any easy work-around and/or an simple way to just save my contours into an XY format so that I can plot them with plot()?
Thank you.