El ejemplo a continuación permite graficar las columnas de un archivo de texto
demo_datos.txt
<code>1 2019/3/919h 5.367320261437908 4.35 18.953969800292256 1.0173202614379084 2 2019/3/920h 5.088235294117647 5.07 0.35838150289016824 0.01823529411764646 3 2019/3/921h 4.963398692810456 5.74 15.646563076112756 0.7766013071895443 4 2019/3/922h 5.195424836601307 5.97 14.908793558938228 0.7745751633986924 5 2019/3/923h 4.759477124183008 5.74 20.60148310903594 0.9805228758169919 6 2019/3/100h 4.196732026143792 5.16 22.952811088615448 0.9632679738562082 7 2019/3/101h 3.350653594771241 4.42 31.914561591729296 1.069346405228759 8 2019/3/102h 1.7934426229508196 3.76 109.6526508226691 1.9665573770491802 9 2019/3/103h 2.1251633986928105 3.23 51.98831308626788 1.1048366013071895 10 2019/3/104h 3.1647058823529406 2.85 9.944237918215592 0.3147058823529405</code>
Ejemplo de como graficar lo siguiente: (Grafico de linea)
<code>%% PREDICCION data=dlmread("datos_demo.txt"); t=data(:,1); %eje x vy=data(:,3); % valores Y (columna 3) ry=data(:,4); % valores Y (columna 4) t1y=data(:,5) % valores Y (columna 5) t2y=data(:,6) % valores Y (columna 6) ery=data(:,7); %valores Y (columna 7) et1y=data(:,8); %valores Y (columna 8) et2y=data(:,9 ); %valores Y (columna 9) plot(t,vy,";indicador 1;", 'linewidth',5,t,t1y,";indicador 2;", 'linewidth',5,t,t2y,";indicador3;", 'linewidth',5); title ({"Indicadores ","grafico de indicadores "}); ylabel("Eje y"); xlabel("Eje x"); </code>
¿Y si quiero plotear más de un grafico en una sola vista?
Se puede usar subplot sobre el grafico (plot) con las coordenadas del grafico
<code>subplot (4, 1, 1) ; plot(t,vp10y,";data indicador p10;", 'linewidth',5,t,vy,";data indicador;", 'linewidth',5,vp90y,";data indicador_p90;", 'linewidth',5); title ({"datas ", "indicador"}); ylabel("Eje y "); xlabel("Eje x"); subplot (4, 1, 2) ; plot(t,vp10y,";data indicador p10;", 'linewidth',5,t,ry,";data avg s;", 'linewidth',5,t,vp90y,";data indicador p90;", 'linewidth',5); title ({"data ", " s Meteo vs indicador"}); ylabel("Eje y"); xlabel("Eje x"); subplot (4, 1, 3); plot(t,vp10y,";data indicador p10;", 'linewidth',5,t,t1y,";data 1;", 'linewidth',5,t,vp90y,";data indicador p90;", 'linewidth',5); title ({"Diferencia data indicador", "Grafico "}); ylabel("Eje y "); xlabel("Eje x"); subplot (4, 1, 4); plot(t,vy,";data indicador;", 'linewidth',5,t,ry,";data avg s;", 'linewidth',5,t,t1y,";data 1;", 'linewidth',5,t,t2y,";data 2;", 'linewidth',5); title ({"Diferencia data indicador", "Grafico "}); ylabel("Eje y"); xlabel("Eje x");</code>