www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/SpecifyLineWidthMarkerSizeAndMarkerColorExample.m

    %% Specify Line Width, Marker Size, and Marker Color
% Create a line plot and use the |LineSpec| option to specify a dashed green
% line with square markers. Use |Name,Value| pairs to specify the line
% width, marker size, and marker colors. Set the marker edge color to blue
% and set the marker face color using an RGB color value.

% Copyright 2015 The MathWorks, Inc.


x = -pi:pi/10:pi;
y = tan(sin(x)) - sin(tan(x));

figure
plot(x,y,'--gs',...
    'LineWidth',2,...
    'MarkerSize',10,...
    'MarkerEdgeColor','b',...
    'MarkerFaceColor',[0.5,0.5,0.5])