Matlab example
#
OverviewFiglinq is compatible with Plotly's Chart Studio Python API, and you can use Plotly's Python chart_studio package to interact with content on Figlinq. This simple example illustrates how you can use this package to create a simple line chart and save it, together with associated data, to your Figlinq account.
#
API key and usernameTo connect to your Figlinq account, you will need to provide your username and API key. You can find both in your account page. There, you can also create a new API key if needed.
#
Privacy settingsBy default, all plots and data grids created with the Python API are currently public. Make sure to override this setting by including the world_readable
parameter set to False
in the set_config_file
function.
#
Instructions- Download the plotly bundle here.
- Unzip the archived folder and enter it within Matlab
- Run
getplotlyoffline('https://cdn.plot.ly/plotly-latest.min.js')
to download the latest version of Plotly.js - Run
plotlysetup_online('YOUR_USER_NAME','YOUR_API_KEY')
to set your credentials. If you get folder permissions error info in output, follow instructions to change permissions manually - Run
saveplotlyconfig('https://create.figlinq.com', 'https://stream.figlinq.com')
to set the Figlinq domain, streaming server (currently unsupported). - Create your first simple heatmap by running:
Note that all plots will be created in your home directory, but after creating you can move or rename them, and of course modify the resulting plots!
#
Result- After running the script, your default browser will open the newly-created plot in view mode.
- If you receive a 404 error after the browser opens, you are likely not logged in. Please make sure that you are logged in to your Figlinq account in your default browser before running the script.
- The newly-created plot and data grid will be available in your home directory - from there you can move them to other folders and edit, restyle, add to a figure or share.
- If you run the script multiple times without changing the filename, the plot and grid will be overwritten.
#
fig2plotly FunctionThe fig2plotly function in the Plotly's MATLAB library is used to convert MATLAB figures into interactive Plotly.js graphs. This function facilitates the process of creating and sharing high-quality, interactive visualizations directly from MATLAB in Figlinq.
#
Syntax#
Input Argumentsfig: The MATLAB figure handle that you want to convert into a Plotly graph. Name-Value pairs: Specify optional parameters using one or more name-value pair arguments in any order. Available options are:
- filename: [string]{'untitled'} - Filename as appears on Plotly.
- fileopt: [string]{'new'} - One of the following options: 'new', 'overwrite', 'extend', 'append'.
- world_readable: [boolean]{true} - public(true) / private(false).
- link: [boolean]{true} - show hyperlink (true) / no hyperlink (false).
- open: [boolean]{true} - open plot in browser (true).
#
Outputresponse: A structure array containing information about the created Plotly graph, such as the graph URL.