Reputation: 165
I'´m trying to plot two variables on a same graph using plotyy. The problem is, when I configure x-axis for date labels, it appears both date and another kind of number labels. How can I set only date labels?
Below it follows the script:
prp_dados = importdata ('c:\experimental\telemetricas_ANA\prp\29070100PARAUAPEBAS_1332013-2032013.txt');
cot_dados = importdata ('c:\experimental\telemetricas_ANA\cota\29070100PARAUAPEBAS_1332013-2032013.txt');
p_date_string = strcat (prp_dados.textdata(2:end,1),{' '}, prp_dados.textdata(2:end,2));
c_date_string = strcat (cot_dados.textdata(2:end,1),{' '}, cot_dados.textdata(2:end,2));
p_xdate = datenum (p_date_string, 'dd/mm/yyyy HH:MM');
plotyy (p_xdate,cot_dados.data,p_xdate,prp_dados.data);
set(gca,'XTick',p_xdate)
datetick('x', 'dd-mm-yyyy');
Upvotes: 0
Views: 1084
Reputation: 2028
Rather than using gca to get only one handle, try using the syntax
[ax,h1, h2] = plotyy()
then you can set the properties for each plot individually.
Upvotes: 1