% Channel ID to read data from readChannelID = 772570; % Channel Read API Key readAPIKey = 'G69NOS1HEH299SKP'; % One day date range dateRange = [datetime('today','TimeZone','Europe/Paris') datetime('now','TimeZone','Europe/Paris')]; % Read data including the timestamp [data,time] = thingSpeakRead(readChannelID,'Fields',1:6,'DateRange',dateRange); % Create variables to store different sorts of data coeff=0.50909; %transforme le nb de basculement en mm de pluie %3,5ml donne un basculement, soit 68,75 mmcube %surface de 12,5 x 5,5mm soit 3500 mmcarré --> 3500/6875=0.50909... Pluie = data(:,6); Pluie = Pluie * coeff; time1=time + hours(2) % GRAPHE bar(time1, Pluie) % Plot hold on %fin d'essai xlabel('Heure') ylabel('mm de pluie') ylim([0 3]) xlim([time1(35) time1(end)+minutes(10)]) title(sprintf('Millimètres de pluie (par 10min)'),'FontSize', 8, 'FontWeight', 'normal') ax=gca ax.XAxis.FontSize = 8; ax.YAxis.FontSize = 8; %set(gcf,'position',[0,0,800,800]) hold off