Fixing y-axis scale | ThingSpeak Apps | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





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

sp_Feed sp_TopicIcon
Fixing y-axis scale
No permission to create posts
December 29, 2017
7:58 pm
Avatar
kim
New Member
Members
Forum Posts: 2
Member Since:
November 4, 2017
sp_UserOfflineSmall Offline

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'});

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

January 3, 2018
8:55 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 222
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

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: Hans, agrisensezm
36 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

Archieter, JamesExedo, IrbosHich, brodi, kasko, franklin castro

Administrators: Hans: 387, lee: 457