Fixing y-axis scale | ThingSpeak Apps | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
Fixing y-axis scale
Avatar
kim
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
1
December 29, 2017 - 7:58 pm
sp_Permalink sp_Print

Hi,

I have the Thingspeak plot below working but I want to fix the scale of the y-axis as  0 to 6.

I believe Ylim does not work with "thingspeakplot" and see from previous posts the suggestion to use "plot" instead but just cannot seem to get it to work.

Any help would be appreciated.

Thanks

Kim

=======================================

[Fence1Data, time] = thingSpeakRead(readChannelID, 'Fields', Fence1FieldID, 'NumPoints', 30, 'ReadKey', readAPIKey);

Fence2Data = thingSpeakRead(readChannelID, 'Fields', Fence2FieldID, 'NumPoints', 30, 'ReadKey', readAPIKey);

thingSpeakPlot(time, [Fence1Data, Fence2Data],'legend',{'Fence1', 'Fence2'});

=============================================

Avatar
cstapels

Gold
Forum Posts: 126
sp_UserOfflineSmall Offline
2
January 3, 2018 - 8:55 am
sp_Permalink sp_Print

You can set the axis to custom values using the pencil icon on your thingSpeak plots. 

If you want to do it in the code, use plot() instead of thingSpeakPlot(). You will be able to use ylim() as you suggested.  For the case you describe above, use ylim([0 6]).

For the plotting, I suggest

plot(time, data1,time,data2);

and then see the documentation for legend to add a legend.

Let us know if that works.

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
21 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:

dannymm1

KamorkasOr

GRV2903

Jusikaclaiz

Raymondpoers

ScottDus

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee