How to define where x axis intercepts y axis

  • Thread starter jemma
  • Start date
  • Tags
    Axis
In summary, the x axis intercept of a line is the point where the line crosses the x axis and has a y value of zero. It can be found by setting y = 0 and solving for x using the equation of the line. The x axis intercept represents the value of x when y is equal to zero and can be used to graph a line by plotting a point on the x axis and finding additional points using the slope and x value of the intercept. It differs from the y axis intercept, which is the point where the line crosses the y axis and has an x value of zero. The x axis intercept can be negative, indicating that the line crosses the x axis to the left of the origin.
  • #1
jemma
36
0
I want to plot a bar plot using matlab.
For example:

x = [0.4 0.5 0.7 0.2 0.1 0.8]
bar(x)
ylim([0 1])

now I want the x-axis to intercept the y-axis at 0.5 so that any bars >0.5 lie above the x-axis and any bars <0.5 are below.

Is this possible?
Thanks.
 
Physics news on Phys.org
  • #2
I'd look into overlaying a horizontal line on top of your bar graph:
http://www.mathworks.com/help/techdoc/creating_plots/f10-19972.html#f10-22444
 
Last edited by a moderator:

Related to How to define where x axis intercepts y axis

1. How do you find the x axis intercept of a line?

The x axis intercept of a line is the point where the line crosses the x axis. To find it, set y = 0 and solve for x using the equation of the line. The resulting x value is the x axis intercept.

2. What does the x axis intercept represent?

The x axis intercept represents the value of x when y is equal to zero. In other words, it is the point where the line crosses the x axis and has a y value of zero.

3. How is the x axis intercept different from the y axis intercept?

The x axis intercept is the point where the line crosses the x axis, while the y axis intercept is the point where the line crosses the y axis. The x axis intercept has a y value of zero, while the y axis intercept has an x value of zero.

4. Can the x axis intercept be negative?

Yes, the x axis intercept can be negative if the line crosses the x axis to the left of the origin. This means that the x value at the intercept is less than zero.

5. How can you use the x axis intercept to graph a line?

The x axis intercept can be used to plot a point on the x axis, which then helps to determine the direction and slope of the line. It can also be used to find additional points on the line by using the slope and the x value of the intercept.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
409
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
Back
Top