Addaxis function with bar plot added
Mostrar comentarios más antiguos
I'm using the 'addaxis' function to add a third y axis to my plot. However, I want my third plot to be a bar plot instead of a line plot. Is there anyway to change this?
Here is the addaxis function:
for i = 1:3
subplot(3,1,i)
name=ComboName(i);
plot(TCD,Combo(:,i),'.k')
xlabel('Date')
ylabel(['C of ', num2str(name)])
ax=gca;
ax.YColor='k';
hold on
addaxis(TQD,Q,'.b')
addaxislabel(2,'F')
hold on
addaxis(time2,rain,'r')
addaxislabel(3,'P')
datetick('x','mm/yyyy')
end
1 comentario
dpb
el 14 de Mzo. de 2020
Dunno, and not going to install to test...but you should be able to retrieve the current axes and do whatever in it directly. Unfortunately, also looks like does NOT return the line handles to the created line in the new axes so you'll have to go handle-diving to retrieve it to delete it...
Why not create the bar plot first instead?
Respuestas (1)
Gaurav Garg
el 30 de Abr. de 2020
0 votos
Hi Eeleen
You can use bar function to plot bar on the third axis.
1 comentario
riccardo scandroglio
el 10 de Mayo de 2021
Hi Gaurav,
could you please provide an example?
Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!