Frage

Is there any way to control size, color and style of the black data points in the figure below?

Image

Cftool

Code

%% Fit: 'untitled fit 1'.
[xData, yData, zData] = prepareSurfaceData( x_lim, y_lim, z_lim );

% Set up fittype and options.
ft = 'linearinterp';

% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, 'Normalize', 'on' );

% Plot fit with data.
figure( 'Name', 'untitled fit 1' );
h = plot( fitresult, [xData, yData], zData );
legend( h, 'untitled fit 1', 'z_lim vs. x_lim, y_lim', 'Location', 'NorthEast' );
% Label axes
xlabel( 'x_lim' );
ylabel( 'y_lim' );
zlabel( 'z_lim' );
grid on
view( -253.5, 42.0 );
War es hilfreich?

Lösung

From your code, the handle returned when you plot, h should be of length 2. h(1) has the details for the surface, and h(2) for the points. Therefore, you can use set on various properties of this handle:

set(h(2),'Marker','o');

(Other properties you may want to set: MarkerSize, MarkerEdgeColor, MarkerFaceColor).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top