4

I am generating a plot of data using pgfplots in latex. I am using data from several excel files as .csv. Here is the MWE:

\documentclass[border=5mm,convert]{standalone}
\usepackage{pgfplots}
\usepackage{siunitx}
\usepgfplotslibrary{fillbetween}
\begin{document}


\begin{tikzpicture}
\begin{axis}[
%width=0.9\textwidth,
%height=6cm,
%title=This is my graph,
xlabel={Crosshead Extension $\Delta$ (\si{\milli\meter})},
ylabel={Load $F$ (\si{\newton})},
xmin=0.0,
ymin=0,
%grid=major,
]

 \addplot+ [smooth,mark=none,name path=boundary1] table [x=CH, y=L, col sep=comma] {ASTMe8Data/SpecimenS6.csv};
 \addplot+ [smooth,mark=none,name path=boundary2,] table [x=CH, y=L, col sep=comma] {ASTMe8Data/SpecimenS5.csv};
 \addplot+ [smooth,mark=none,name path=boundary3,] table [x=CH, y=L, col sep=comma] {ASTMe8Data/SpecimenS4.csv};
 \addplot+ [smooth,mark=none,name path=boundary4,] table [x=CH, y=L, col sep=comma] {ASTMe8Data/SpecimenS3.csv};
 \addplot+ [smooth,mark=none,name path=boundary5,] table [x=CH, y=L, col sep=comma] {ASTMe8Data/SpecimenS2.csv};
 \addplot+ [smooth,mark=none,name path=boundary6,] table [x=CH, y=L, col sep=comma] {ASTMe8Data/SpecimenS1.csv};

\addplot [color=gray!35] fill between [of=boundary1 and boundary2];
\addplot [color=gray!35] fill between [of=boundary1 and boundary3];
\addplot [color=gray!35] fill between [of=boundary1 and boundary4];
\addplot [color=gray!35] fill between [of=boundary1 and boundary5];
\addplot [color=gray!35] fill between [of=boundary1 and boundary6];
\addplot [color=gray!35] fill between [of=boundary2 and boundary3];
\addplot [color=gray!35] fill between [of=boundary2 and boundary4];
\addplot [color=gray!35] fill between [of=boundary2 and boundary5];
\addplot [color=gray!35] fill between [of=boundary2 and boundary6];
\addplot [color=gray!35] fill between [of=boundary3 and boundary4];
\addplot [color=gray!35] fill between [of=boundary3 and boundary5];
\addplot [color=gray!35] fill between [of=boundary3 and boundary6];
\addplot [color=gray!35] fill between [of=boundary4 and boundary5];
\addplot [color=gray!35] fill between [of=boundary4 and boundary6];
\addplot [color=gray!35] fill between [of=boundary5 and boundary6];

\end{axis}
\end{tikzpicture}

\end{document}

As seen in the MWE, I am calling out six .csv files and using the CS column as my horizontal axis and L column as Y axis. This data is from a tensile steel strength test. These graphs are of crosshead distance vs. Force applied to the steel material as time elapses.

MikTex ran out of memory because each file has about 500 rows of data in each column. I am trying to develop an envelope of the six data curves. The problem is related to the fact that I have too many data rows in my .csv excel file. Is there any way to tell pgfplots to only select a certain range of data from the .csv file? Say rows 30-200 in excel? My hope is to cut off some of the initial data and final data because these "book end" data ranges don't do much for the graph. Any help would be greatly appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.