필터 지우기
필터 지우기

How to reduce size of points on a plot?

조회 수: 9 (최근 30일)
Jasnoor Singh
Jasnoor Singh 2016년 5월 25일
편집: Voss 2024년 1월 9일
Following is my figure output. The blue dots are the original pressure values and the curve has been fitted. Is it possible to reduce the size of the blue dots so that I can visualise the curve more clearly? I want the original values to stay on the plot but reduce the size of the blue dots. Any suggestions please? My code is written below for your reference. Thanks.
x = 1:44;
y = 1:44;
for i = 13
a = xlsread('\\engdfs\air.xlsx',strcat('CO',int2str(46*i-18),':','EF',int2str(46*i+25)));
[xData, yData, zData] = prepareSurfaceData( x, y, a );
ft = 'loess';
[fitresult, gof] = fit( [xData, yData], zData, ft, 'Normalize', 'on' );
figure;
h = plot( fitresult, [xData, yData], zData );
c = colorbar;
c.Label.String = 'Pressure (kPa)';
caxis([-5 95]);
legend( h, 'Fitted Curve', 'Original Pressure Values', 'Location', 'NorthEast' );
xlabel('X-Direction','rotation',20,'FontSize',10);
ylabel('Y-Direction','rotation',-30,'FontSize',10);
zlabel('Pressure (kPa)','FontSize',10);
grid on;
axis([1 44 1 44 -5 95]);
set(gca,'TickDir','out');
fname = sprintf('Contour %d.png',i);
fullFileName = fullfile('\\engdfs\Analysis',fname);
saveas(gcf,fullFileName);
end

답변 (1개)

Voss
Voss 2024년 1월 9일
% example data:
xData = (1:10).';
yData = (1:10).';
zData = rand(10,1);
% perform the fit:
ft = 'loess';
[fitresult, gof] = fit( [xData, yData], zData, ft, 'Normalize', 'on' );
% plot the fit:
h = plot( fitresult, [xData, yData], zData)
h =
2×1 graphics array: Surface (curvefit.gui.FunctionSurface) Line
% set the line's MarkerSize:
h(2).MarkerSize = 4;

카테고리

Help CenterFile Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by