Show Sidebar Hide Sidebar

Sending data to charts in MATLAB

How to send data to charts in Python. Examples of overwriting charts with new data, extending traces, and adding new traces.

# Learn about API authentication here: https://plot.ly/matlab/getting-started
# Find your api_key here: https://plot.ly/settings/api

plotly([1, 2], [1, 2], struct('filename', 'name-of-my-plotly-file'))
The simplest and recommended way to update a chart remotely.
You can overwrite a chart's data with new data remotely, simply by including its file name in the filename kwarg.
# Learn about API authentication here: https://plot.ly/matlab/getting-started
# Find your api_key here: https://plot.ly/settings/api

plotly([1, 2], [1, 2], struct('filename', 'name-of-my-plotly-file', 'fileopt', 'extend'))
Add data to an existing trace by setting fileopt='extend'.
This method is used for embedded systems that may not have the memory for a full overwrite of the chart data in one API call.
# Learn about API authentication here: https://plot.ly/matlab/getting-started
# Find your api_key here: https://plot.ly/settings/api

plotly([1, 2], [1, 2], struct('filename', 'name-of-my-plotly-file', 'fileopt', 'append'))
NOT RECOMMENDED
When updating a chart's data remotely, we recommend overwriting all of the chart's data instead of adding new traces.
Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to a Developer Support Plan.