Unplot

Versión 1.0.0 (1,48 KB) por Derek Wood
Transfer data from a plot into the working environment -- Extracts all data from a given figure axes back into a matlab variable
13 descargas
Actualizado 9 jun 2022

Ver licencia

An incredibly handy tool that I find myself using all the dang time.
The purpose is to return the data stored in a matlab figure back into the environment as a variable. This is useful especially if you tend to save lots of .fig files-- with this tool you no longer need to grab the original data if you want to replot. Or, if you generate plots via GUI, you can pull the data out in a way that is useful.
Or, if you just have 200 plots open and don't remember exactly which data set you happened to use on that one graph over there, you can still get the data back.
The tool will work with scatter/line plots (2d or 3d), images, bar graphs, and histograms.
Use case:
data = unplot( axis_handle );
If no input is given, it defaults to the active axes in the current figure (gca).
Output is a struct array, with each line/image/etc in the plot being given an entry in the array.
type: 'type of data'
name: 'display name of the data set - matches the plot legend'
X: [1×N double]
Y: [1×N double]
Z: [1×N double]
C: [NxM double]
The TPE field indicates the type of data; 'line', 'image', etc.
The NAME with match the DisplayName property of the plot element.
The X,Y,Z fields all contain the data. For 2d data, Z is an empty array, and for image data, they will return the image scale axis (if any exist, otherwise they will be empty).
the C field contains color, i.e. image data.
If you have multiple lines in the plot, the data will appear in the array in the same order that they appear on the plot legend.

Citar como

Derek Wood (2024). Unplot (https://www.mathworks.com/matlabcentral/fileexchange/112905-unplot), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2018b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Etiquetas Añadir etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0