File Exchange

image thumbnail


version (805 Bytes) by Jörg Petzold
Simple exporting and reducing data shown in matlab figures for pgfplots

1 Download

Updated 07 Feb 2018

View License

A small function that captures the currently visible data in a matlab line plot and exports to a data file instantly readable with pgfplots in latex. It is based on and needs the reduce_to_width function by Tucker McClure available here:
Its automatically reduces the number of samples to the minimum to reproduce the displayed matlab graph in the pgf axes. Works also with zoomed data. Note that the reduction results depend on the figure width and height.

Comments and Ratings (3)

This is a nice function to avoid the error message 'TeX capacity exceeded, sorry' that almost everyone has encountered who has plotted larger datasets with the pgfplots package in LaTeX.
Here is a short test and demo program for this function:

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Plot (Big)

Inspired: matlab2dplot2datafile

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor