Installing Plotly Graphing Library for MATLAB® …
Once the library is downloaded, we proceed to open our MATLAB. Then, in the MATLAB command window please go to the library folder resulting from the download. In my case it would be something like this
So, to install you only need to run one of the following files (which are indicated in the previous image): 1) plotlysetup_offline.m
(preferably) or 2) plotlysetup_online.m
. To do this, you just need to run the following line in the MATLAB command window
plotlysetup_offline('https://cdn.plot.ly/plotly-latest.min.js')
After executing the previous line, the following should appear
With all this we are ready to start using the power of the Plotly Graphing Library for MATLAB®
To do a quick first test, please run the following MATLAB code:
r = @(s,t) 2 + sin(7.*s + 5.*t);
x = @(s,t) r(s,t).*cos(s).*sin(t);
y = @(s,t) r(s,t).*sin(s).*sin(t);
z = @(s,t) r(s,t).*cos(t);
fmesh(x,y,z,[0 2*pi 0 pi]);
f = fig2plotly(gcf, 'offline', 1);
With which the following charts will be created
On the right you can see the chart generated by MATLAB. On the left you can see the rich chart created by Plotly . Beautiful, right!
In future topics I will teach you how to use this powerful library in more detail. See you in the next topic