Determine Height and Width of Thingspeak MATLAB Visualization Plot

M.T. Frieze on 22 Jul 2021
Latest activity Reply by Vinod on 22 Jul 2021

I have Thingspeak MATLAB visualizations that I call using https://thingspeak.com/apps/matlab_visualizations/nnnnn?width=800&height=700 (where nnnnn is the visualization number). In the MATLAB code, is it possible to determine the width and height parameters that were sent, in this case 800 and 700?

Thanks! Tom

Vinod
Vinod on 22 Jul 2021

The idea is the MATLAB code should not need to know the size. You do the plot in MATLAB and by specifying the height and width parameter to the API request, the MATLAB plot stretches to fill the requested height and width.

M.T. Frieze
M.T. Frieze on 22 Jul 2021

The reason I would like to determine these parameters is that I call with different width/height depending on whether I am viewing on a computer or on my phone. I would like to make a simpler plot with less overlaid graphs when viewing on a phone rather than on a large monitor. So if I could determine the width/height of the URL call, I can use this to change what I include on the plot.

Alternatively, is there any way to include any additional optional parameters in the calling URL that can be determined in the MATLAB code?

Thanks

Vinod
Vinod on 22 Jul 2021

There are no parameters that get passed back from the API call to the MATLAB code. My recommendation is to create 2 separate MATLAB visualizations and you can use a different link when you are on the computer or on the mobile phone.