MATLAB: Shifting x-axis x axis reposiiton Hi, I want to shift the x-axis from the bottom to the top of a figure using the command line. I know how to do it by using the plot tools. I would like to know how to do it via the command line. Thanks Best Answer plot(1:10)set(gca,'XAxisLocation','top') Related SolutionsMATLAB: 2 scales on an ax You can make the right y-axis invisible like this. First, create two axesax = axes();plot(rand(1,10))yyaxis('right');plot(rand(1,10))then make the right axes invisible using thisyyaxis('right');ax.YAxis(2).Visible = 'off'; MATLAB: How to create a second x axis with different intervals You've actually got three copies of the one axes handle (ax,ax1,ax2); you've never created a second axes.hSc=scatter(rand(10,1)*2,randi([-720 -120],10,1),'^')hAx1= gca;hAx1.YLim=[-750 -100];xticks(hAx1,[0:0.25:3])hAx1.XAxisLocation= 'top';hAx2=axes('position',hAx1.Position,'color','none');hAx2.XAxisLocation='bottom';xticks(hAx2,[0:5:25])hAx2.YTick=[];xlim(hAx2,[0 25])box onresults in Related QuestionHow to make all but one axis visible on plotPlotyy with axis for each plot only on one sideHow to plot the Xticklabel on the top of the axesUsing Multiple X- and Y-Axes Command Axis LabelHow to have a graph with labeled x-axis ticks on the bottom and top of the graph
Best Answer