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: 4
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: 867
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: 166

Currently Online:
26 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Team_mafia, icXu, emorphistechno, VTVMART, manimozhi, adamhebrew

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457