drawing point by point matlab using plot or another function instead of viscircle

1 次查看(过去 30 天)
Hello, I need to draw point by point, but the points should be a little bit big so i already did a program and worked with viscircle, but i saw that visrcle can't allow us to fill in the circles so now i should change my methode so tried to use the plot but didn't work correctly can you suggest me any idea to change this program to another one using plot or line or what else. i'm working on a gui.
function start_Callback(hObject, eventdata, handles)
axes(handles.axes1)
axis(gca,'equal');
axis([0 120 0 (110)]);
for x=0:(distance/1000):(bounce/2)
y=a*x.^2 + hauteur;
p2=[x y];
p2_traj= viscircles(p2,0.6);
pause(0.0001);
delete(p2_traj);
if rebounce ==1 && y<= rebounce1
newrow=[rebounce1,0,0,0];
break;
end
end
  5 个评论
Jacob Mathew
Jacob Mathew 2024-11-29
Additionally, if you want the markers themselves to be filled, you can set the MarkerFaceColor property. However, if you want the plotted area to be filled then use the fill function. Both of these are visualised in the code below:
% Define the number of data points
numPoints = 100;
% Define the radius of the circle
radius = 4;
% Create an array of angles from 0 to 2*pi
theta = linspace(0, 2*pi, numPoints);
% Calculate the x and y coordinates of the circle
x = radius * cos(theta);
y = radius * sin(theta);
% Plot and fill the circle
figure;
fill(x, y, 'c'); % 'c' is for cyan fill; you can choose other colors
hold on;
plot(x, y, 'o', 'MarkerFaceColor', 'b'); % Plot the outline with solid markers
axis equal; % Ensure the aspect ratio is equal to make the circle look round
title('Circle with Radius 4 Units');
xlabel('X-axis');
ylabel('Y-axis');
grid on;
You can reference the documentation for customising marker property in the following documentation link below:
Further, to reference the fill function's documentation, visit the link below:

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by