MATLAB: How to add multiple axes to a log-log plot

log log plotmultiple axes

I would like to create a log-log-plot with multiple x-axes. My goal is to display my data 'y' as function of 'x' and as a function of 'u=a*x' simultaneously. I have seen examples of plots with multiple axes but did not come across any log-log plot. Is there a way to achieve this?
Any hint would be appreciated, Christian

Best Answer

You have to set the xscale and yscale property of ax2 to 'log':
x1 = 1:1000;
y1 = x1.^2;
x2 = 2*x1;
y2 = y1;
loglog(x1,y1,'r')
hold on,
ax2=axes('xaxislocation','top','yaxislocation','right','color','none', 'xscale', 'log', 'yscale', 'log')
hold on
loglog(x2,y2,'g')
Related Question