Hi all, Thank you in advance, I have to plot two scatter plots with different x axis values. I want the x axis values positioned up and down the plot and the y axis on the left as usual. I know in the normal plot function, changing the axis position is possible in the plot properties. However, I checked the scatter plot properties in the doc and it appears there is no such properties as axis position. When I try to find a way around this by using hold on, the first plot seems to be written over by the second. I need you assistance please. Here is my MWE
y = [0:20];
x1 = rand(1,length(y));
x2 = rand(1,length(y));
scatter(gca,x1,y,'MarkerFaceColor',[0 .7 .7],...
ax1 = gca;
hold on ax2 = axes('Position',get(ax1,'Position'),... 'XAxisLocation','top','XColor','k','YColor','k'); scatter(ax2,x2,y,'MarkerFaceColor',[0 1 0],... 'LineWidth',1.5) xlabel('x2'); ylabel('y'); hold off