Now we still have the problem that the XTicks of ax(1) are also displayed at the top, and the XTicks of ax(2) are displayed at the bottom. Let's set the limits to the minimum and maximum of the x2 vector, and make it logarithmic: set(ax(2),'XLim',) Now lets just format the second X axis as we like. As this adds a second Y axis too, we simply remove the Y ticks of the second axis. Then we create the second axes object, at the same position as the first, and make the color none so it is transparent and the plot from below is still visible. Now we can create a normal plot with the first axes, and get the axes handle: plot(x1,y,'-r') Let's first create some data: x1 = 1:0.1:3.5 This can be done by simply creating a second axes object at the same place as the first.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |