Question about plotyy with one semilog axis?

2 vues (au cours des 30 derniers jours)
Lolak
Lolak le 22 Juin 2016
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.

Réponses (1)

Steven Lord
Steven Lord le 22 Juin 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'.

Catégories

En savoir plus sur Two y-axis dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by