Plotting circles horizontally through entire range of x values on a constant y value

How do i plot circles for the entire range of the x values for a constant y value instead of a horizontal line through the range of x values?

 Accepted Answer

I am not certain what you want.
Try this:
x = rand(10,1);
y = ones(size(x))*0.5;
figure
plot(x, y, 'o')

7 Comments

Eg: distance = 9.5 i used logarithmic scale to plot my graph, and i want that distance to be horizontal red circles across the entire range of the x axis
I have no idea what you intend with respect to the spacing.
You can plot red circles by specifying the colour:
figure
plot(x, y, 'ro')
and y axis is ranged from 10^0 to 10^9 , i want a horizontal circles through the entire range of the x axis at point y= 10^4
Try this:
N = 50;
x = logspace(0, 4, N); % Choose 50 Values Between 10^0 and 10^4 FOr ‘x’
y = ones(size(x))*1E+4; % Matching ‘y’ Vector
figure
plot(x, y, 'ro')
grid
figure
loglog(x, y, 'ro')
grid
One of these should do what you want. See the documentation for the plot (link) function for details and other axis scaling options. You can change the number of points (circles) by changing the value of ‘N’.

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!