How to define where x axis intercepts y axis

  • Thread starter Thread starter jemma
  • Start date Start date
  • Tags Tags
    Axis
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
jemma
Messages
35
Reaction score
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
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: