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
omar Benamiar Messari
omar Benamiar Messari 2018년 7월 19일
I'll do it again and i'll show you what did it gave me
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