Effacer les filtres
Effacer les filtres

How to reduce size of points on a plot?

9 vues (au cours des 30 derniers jours)
Jasnoor Singh
Jasnoor Singh le 25 Mai 2016
Modifié(e) : Voss le 9 Jan 2024
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

Réponses (1)

Voss
Voss le 9 Jan 2024
% 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;

Catégories

En savoir plus sur Discrete Data Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by