フィルターのクリア

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 Center および File ExchangeDiscrete Data Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by