Silver

Hi,

I'm posting weather data to a few channels on ThingSpeak, for example this outdoor temperature:

I know how to change the color for the entire line in the graph, but since this is an outdoor temperature in Norway - where the temperature changes between above and below freezing on a regular basis - it would be really nice to have the graph line have different colors above and below freezing. Specifically, I would like it to be blue below 0 (freezing point on the Centigrade scale) and red above 0.

Any ideas how to do that?

I dont know if any way to modify the thingspeak basic grapsh. If you use a Matlab visualization you can sort your values into 2 series (above and below zero in your case) and plot them on the same graph with different colors.

Hopefully someone with matlab skills can give us code for that..

Here is an example MATLAB code snippet to help you get started:

% Read data from your channel

[data, time] = thingSpeakRead(130083, 'NumPoints', 8000, 'Fields', 1);

% Create variables for holding values greater than zero and less than zero

dataGtZero = NaN(1, length(data));

dataLsZero = NaN(1, length(data));

% Assign values to the variables

% dataGtZero has all values of data that are greater than zero

dataGtZero(data>0) = data(data>0);

% dataLsZero has all values of data that are less than zero

dataLsZero(data<0) = data(data<0);

% Plot both chunks of data and specify color to be blue ('b') for data less than zero and red for the other.

plot(time, dataLsZero, 'b');

hold on;

plot(time, dataGtZero, 'r')

Most Users Ever Online: 114

Currently Online:

38 Guest(s)

Currently Browsing this Page:

1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

ibgedubo

aogomaeqaza

ureomug

itixuwidouzuv

eilimir

memozupi

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee