Question about plotyy with one semilog axis?
3 views (last 30 days)
Show older comments
Hi,
I would like to use plotyy to plot two y vectors agaist an x axis for which I use plotyy(x,y1,x,y2). My problem is that I want my y1 and y2 to plot as scatter plots also my y2 axis have log scale. So to go with the correct scales I know that I have to go plotyy(x,y1,x,y2,'plot','semilogy') but now how can I tell Matlab to plot them in scatter format. I would apprecite any comment on this, thanks.
0 Comments
Answers (1)
Steven Lord
on 22 Jun 2016
If you're using a release that contains it (release R2016a or later) use the yyaxis function to set up the axes onto which you want to plot rather than calling plotyy.
Otherwise write a function that accepts two input arguments and returns a graphics handle and pass a function handle to that function into plotyy. Inside that function create your scatter plot and set the YScale property of the axes containing the scatter plot to 'log'.
0 Comments
See Also
Categories
Find more on Two y-axis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!