How can apply scatter or plot functions with two xx and yy axis?
9 views (last 30 days)
Riyadh Muttaleb on 21 Jan 2019
I am try to use the code below that I got it from : https://www.mathworks.com/help/matlab/creating_plots/graph-with-multiple-x-axes-and-y-axes.html
to apply it with plot OR scatter fuctions but it does't work!
I have histogram in the first plot and Scatter OR plot in the socond.
Thanks in advance
x1 = 0:0.1:40;
y1 = 4.*cos(x1)./(x1+2);
ax1 = gca; % current axes
ax1.XColor = 'r';
ax1.YColor = 'r';
ax1_pos = ax1.Position; % position of first axes
ax2 = axes('Position',ax1_pos,...
x2 = 1:0.2:20;
y2 = x2.^2./x2.^3;