Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to cut the x axis in matlab

Status
Not open for further replies.

tlko

Electrical
Mar 16, 2006
4
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
 
Replies continue below

Recommended for you

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
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor