What is the correct handle for a scatter plot with 2 y-axes?
Show older comments
Hi, I think my question is very beginner, but I can't figure it out right now.
I want to make a scatter plot with 2 y-axes. Unfortunately, I have Matlab 2015b and cannot use yyaxis.
Instead, I found the following syntax to make a scatter plot
[ax, p1, p2]=plotyy(x1,y1,x2,y2);
set(p1,'Color','w'); % Color the lines white, so I only see the markers
set(p2,'Color','w');
The goal is to fit a regression line afterwards.
hold(ax(1),'on')
scatter(ax(1),x1,y1)
hold(ax(2),'on')
scatter(ax(2),x2,y2)
set(get(ax(1), 'Ylabel'), 'String', '\sigma_F_A');
set(get(ax(2), 'Ylabel'), 'String', '\sigma_M_D');
I managed to set the axis titles but I also want to set marker colors and shapes, as well as axis limits manually. But I don't know what to put instead of ax(1) and ax(2) to achieve the correct target.
When I "set(x1...)" or "set(get(y1,...))" the following error message pops up
Error using handle.handle/get Invalid or deleted object.
I hope you understand my question, thanks a lot in advance.
Accepted Answer
More Answers (1)
Hi,
see the R2015b documentation for how to:
Best regards
Stephan
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!