How to reduce size of points on a plot?
조회 수: 9 (최근 30일)
이전 댓글 표시
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/165066/image.png)
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
댓글 수: 0
답변 (1개)
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)
% set the line's MarkerSize:
h(2).MarkerSize = 4;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!