×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

how to cut the x axis in matlab

how to cut the x axis in matlab

how to cut the x axis in matlab

(OP)
Hello. I would like to plot a graph in Matlab with the x axis from 8 to 18 bu with two sections, one from 8 to 10 and other from 16 to 18. I would like to skip the part from 10 to 16 making a mark or a curve.
I don't know if you understand what I want, it's not easy to explain it.

Anyway, thank you

RE: how to cut the x axis in matlab

in your vector of x-coordinates put a value in the appropriate place of x = 13. At the same position in the y-coordinate vector, put a value of y = NaN. This will force Matlab to put a break in the curve.

x = 1:10
y = rand(1,10)
x([6 7]) = NaN

plot(x,y)

M

--
Dr Michael F Platten

RE: how to cut the x axis in matlab

(OP)
Thank you for your answer but what I want is to make a brake in the x axis, I mean, a real break.
Something like this ----//----

I want to put is two bent lines cutting the line of the axis.

I hope you understand me.

Thank you

RE: how to cut the x axis in matlab

2 plots will do that no?

RE: how to cut the x axis in matlab

(OP)
If I plot one part from 8 to 10, hold on, and plot the second part from 16 to 18, it automatically fill the x axis from 10 to 16. I don't want to write the x axis from 10 to 16.

I want and x axis with only these 6 ticks:
8 9 10 // 16 17 18

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources