MATLAB: Plotting two x aes and 1 y axes for one plot plotx axes I made the function simple. the code i have used is: x1= [0: 0.1 : (2*pi*1)]; y=sin(x1); plot (x1,y) This helps me to plot the curve for magnitude vs time. I am unable to add the 'delta' x- axes? Best Answer Example with two axes. Idea is from HEREx1 = 0:0.1:40;y1 = 4.*cos(x1)./(x1+2);plot(x1,y1,'r')ax1 = gca;ax1_pos = get(ax1,'Position'); % position of first axes % align second axes (transparent)ax2 = axes('Position',ax1_pos,... 'Color','none');ax1_pos(2) = ax1_pos(2) + 0.1; % move first axes upax1_pos(4) = ax1_pos(4) - 0.1; % make Ysize of axes smallerset(ax1,'Position',ax1_pos)set(ax2,'YTick',[]) % remove Y axis ticksxlim(ax2,[0 5])set(ax2,'XTick',0:2:5) Related SolutionsMATLAB: How can apply scatter or plot functions with two xx and yy axis Riyadh,Have you tried using the yyaxis command instead of the line? MATLAB: Two x-axis for the same y-axis You're on the right track with some of the stuff you have tabbed out. All you need is to set the x and y limits for your ax2 axes. set(ax2,'XDir','reverse');ylim(ax2,[33 1600]); %set the y and x limits on ax2xlim(ax2,[0 100])From here, you can just change the ax2 x axis limits to be whatever you want them to be, and use the regular commands for the ticks etc. Related QuestionMultiple X-Axes with separate scales and xlabelsPlot with Multiple x-Axes and y-Axes using the fill functionHow to create 4 axis on one single plotUnable to link x-axis in subplotCan I plot 5 y-axis
Best Answer