Creating a plot with 2 x -axis

3 visualizaciones (últimos 30 días)
asd ad
asd ad el 16 de Ag. de 2020
Comentada: asd ad el 16 de Ag. de 2020
Hello everyone,
I would like to create a bar or a line plot with two x-axes from the xlsx file attached to this question. How do I do this? I would like the droplet size to be on the bottom x-axis and the distance to be on the top x-axis with the frequency on the y-axis. What is the easy way to do this?
Thanks

Respuestas (1)

Sara Boznik
Sara Boznik el 16 de Ag. de 2020
Read about plotyy.
  5 comentarios
Sara Boznik
Sara Boznik el 16 de Ag. de 2020
AX=plotyy(DropletSizemicrons,Frequency,'-b.','Markersize',25)
xlabel('Droplet size [microns]')
set ( gca, 'xdir', 'reverse' )
set(AX(2),'XAxisLocation','Top')
ylabel('Frequency')
I get error with Unrecognized function or variable 'DropletSizemicrons'.
asd ad
asd ad el 16 de Ag. de 2020
Error in plotyy>fevalfun (line 376)
h = feval(func,x,y);
Error in plotyy (line 78)
[h1,ax(1)] = fevalfun(fun1,ax(1),x1,y1,caxspecified);
Error in Untitled4 (line 25)
AX= plotyy(DropletSizemicrons,Frequency,'-b.','Markersize',25);
I get this error. DropletSizemicrons is the first column in the excel sheet which I imported using the import data function and then converted into column vectors. Apparently, it's an error in the plotyy function

Iniciar sesión para comentar.

Categorías

Más información sobre Two y-axis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by