Plotting circles horizontally through entire range of x values on a constant y value
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
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
Star Strider
on 2 May 2018
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
Lorenne
on 3 May 2018
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')
Lorenne
on 3 May 2018
x axis is ranged from 10^0 to 10^4
Lorenne
on 3 May 2018
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’.
Lorenne
on 3 May 2018
This works, thanks!
Star Strider
on 3 May 2018
As always, my pleasure!
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Tags
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)