Empty line treatment when reading tables in pgfplotsmaking a box in beamer — pausing within frame to show...
How do I tell my manager that his code review comment is wrong?
How could a planet have most of its water in the atmosphere?
Game of Life meets Chaos Theory
What happens if I start too many background jobs?
Why do freehub and cassette have only one position that matches?
How to implement float hashing with approximate equality
Surprising behavior of Part[ ]
Is this homebrew race based on Draco Volans balanced?
Printing a string when grep does not get a match
Why is Thanos so tough at the beginning of "Avengers: Endgame"?
Survey Confirmation - Emphasize the question or the answer?
Post Endgame, how is the flow of time different?
How to reply this mail from potential PhD professor?
Loading but not using TikZ changes a file
Why is Arya visibly scared in the library in S8E3?
Historically, were women trained for obligatory wars? Or did they serve some other military function?
Hang 20lb projector screen on hardieplank
Who died in the Game of Thrones episode, "The Long Night"?
Why was the pattern string not followed in this code?
Isomorphism of fields via the forgetful functor
Is it the same airport YUL and YMQ in Canada?
Is Cola "probably the best-known" Latin word in the world? If not, which might it be?
Melee attacking upwards (enemy on 10ft ceiling)
How to avoid grep command finding commented out strings in the source file?
Empty line treatment when reading tables in pgfplots
making a box in beamer — pausing within frame to show new content using onlyplotting two time series with boundspgfplots markers and lines on different layersHow do i get the x axis on top but keep a line on the bottomHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?How to hide empty (value 0) ybars with pgfplots?Show mark labels near marks and not centered in ybar interaval graphpgfplots: percentage in matrix plotCenter the axes in the coordinate originFill area of the spectral curve with CIE Chromaticity fading to generate a CIE Chromaticity Diagram in pgfplots
I have the problem that in some scenarios plots from tables are not drawn if empty lines are in the read input file. Boundaries etc. are drawn and set correctly and no errors are shown in the log.
Let's directly start with the MWE
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents}{data1.txt}
0 0
1 1
end{filecontents}
begin{filecontents}{data2.txt}
0 0
1 1
end{filecontents}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black] table[x index =0, y index = 1,] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1,] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
and the outcome

The desired outcome would of course contain two identical lines:

When the same is done with pgfplotstableread, both command work fine (i.e., both datasets work). But for large datasets, this is not an option.
Somehow, the simple table {filename} has problems with an empty line inside table data. Interestingly, this does not occur if the first addplot does not receive and options (not even empty ones []).
Is this desired behavior? Is there an option to ignore empty lines also when reading tables like done in the MWE?
tikz-pgf pgfplots pgfplotstable
add a comment |
I have the problem that in some scenarios plots from tables are not drawn if empty lines are in the read input file. Boundaries etc. are drawn and set correctly and no errors are shown in the log.
Let's directly start with the MWE
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents}{data1.txt}
0 0
1 1
end{filecontents}
begin{filecontents}{data2.txt}
0 0
1 1
end{filecontents}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black] table[x index =0, y index = 1,] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1,] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
and the outcome

The desired outcome would of course contain two identical lines:

When the same is done with pgfplotstableread, both command work fine (i.e., both datasets work). But for large datasets, this is not an option.
Somehow, the simple table {filename} has problems with an empty line inside table data. Interestingly, this does not occur if the first addplot does not receive and options (not even empty ones []).
Is this desired behavior? Is there an option to ignore empty lines also when reading tables like done in the MWE?
tikz-pgf pgfplots pgfplotstable
add a comment |
I have the problem that in some scenarios plots from tables are not drawn if empty lines are in the read input file. Boundaries etc. are drawn and set correctly and no errors are shown in the log.
Let's directly start with the MWE
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents}{data1.txt}
0 0
1 1
end{filecontents}
begin{filecontents}{data2.txt}
0 0
1 1
end{filecontents}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black] table[x index =0, y index = 1,] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1,] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
and the outcome

The desired outcome would of course contain two identical lines:

When the same is done with pgfplotstableread, both command work fine (i.e., both datasets work). But for large datasets, this is not an option.
Somehow, the simple table {filename} has problems with an empty line inside table data. Interestingly, this does not occur if the first addplot does not receive and options (not even empty ones []).
Is this desired behavior? Is there an option to ignore empty lines also when reading tables like done in the MWE?
tikz-pgf pgfplots pgfplotstable
I have the problem that in some scenarios plots from tables are not drawn if empty lines are in the read input file. Boundaries etc. are drawn and set correctly and no errors are shown in the log.
Let's directly start with the MWE
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents}{data1.txt}
0 0
1 1
end{filecontents}
begin{filecontents}{data2.txt}
0 0
1 1
end{filecontents}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black] table[x index =0, y index = 1,] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1,] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
and the outcome

The desired outcome would of course contain two identical lines:

When the same is done with pgfplotstableread, both command work fine (i.e., both datasets work). But for large datasets, this is not an option.
Somehow, the simple table {filename} has problems with an empty line inside table data. Interestingly, this does not occur if the first addplot does not receive and options (not even empty ones []).
Is this desired behavior? Is there an option to ignore empty lines also when reading tables like done in the MWE?
tikz-pgf pgfplots pgfplotstable
tikz-pgf pgfplots pgfplotstable
edited 2 hours ago
Faekynn
asked 2 hours ago
FaekynnFaekynn
1,0001825
1,0001825
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
To weed out empty rows you only need to say empty line=none, see p. 45 of the manual.
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents*}{data1.txt}
0 0
1 1
end{filecontents*}
begin{filecontents*}{data2.txt}
0 0
1 1
end{filecontents*}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black,empty line=none] table[x index =0, y index = 1] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
Oh i know. (I tried to mention in the text that this works). But for large data it is not very practical. (The manual says the macro version is slower from 200 entries on)
– Faekynn
2 hours ago
@Faekynn Oh, sorry, I misread this. Then I do not know an answer but personally I feel that, if you want to deal with huge data sets and want to have high performance, you may want to weed these empty lines out with some faster tools like perl or something of that sort.
– marmot
2 hours ago
Perl, sed and so are of course possible, but not that portable. I guess it should be possible though: writing justaddplot table {file}surprisingly works. Only once i add a plot option, the graph disappears. So, in some cases it is treated correctly...
– Faekynn
2 hours ago
Maybe somebody else knows with a deeper understanding of the pgfplots interna...
– Faekynn
2 hours ago
@Faekynn I completely revised the answer. You only need to sayempty line=none.
– marmot
2 hours ago
|
show 2 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488286%2fempty-line-treatment-when-reading-tables-in-pgfplots%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
To weed out empty rows you only need to say empty line=none, see p. 45 of the manual.
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents*}{data1.txt}
0 0
1 1
end{filecontents*}
begin{filecontents*}{data2.txt}
0 0
1 1
end{filecontents*}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black,empty line=none] table[x index =0, y index = 1] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
Oh i know. (I tried to mention in the text that this works). But for large data it is not very practical. (The manual says the macro version is slower from 200 entries on)
– Faekynn
2 hours ago
@Faekynn Oh, sorry, I misread this. Then I do not know an answer but personally I feel that, if you want to deal with huge data sets and want to have high performance, you may want to weed these empty lines out with some faster tools like perl or something of that sort.
– marmot
2 hours ago
Perl, sed and so are of course possible, but not that portable. I guess it should be possible though: writing justaddplot table {file}surprisingly works. Only once i add a plot option, the graph disappears. So, in some cases it is treated correctly...
– Faekynn
2 hours ago
Maybe somebody else knows with a deeper understanding of the pgfplots interna...
– Faekynn
2 hours ago
@Faekynn I completely revised the answer. You only need to sayempty line=none.
– marmot
2 hours ago
|
show 2 more comments
To weed out empty rows you only need to say empty line=none, see p. 45 of the manual.
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents*}{data1.txt}
0 0
1 1
end{filecontents*}
begin{filecontents*}{data2.txt}
0 0
1 1
end{filecontents*}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black,empty line=none] table[x index =0, y index = 1] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
Oh i know. (I tried to mention in the text that this works). But for large data it is not very practical. (The manual says the macro version is slower from 200 entries on)
– Faekynn
2 hours ago
@Faekynn Oh, sorry, I misread this. Then I do not know an answer but personally I feel that, if you want to deal with huge data sets and want to have high performance, you may want to weed these empty lines out with some faster tools like perl or something of that sort.
– marmot
2 hours ago
Perl, sed and so are of course possible, but not that portable. I guess it should be possible though: writing justaddplot table {file}surprisingly works. Only once i add a plot option, the graph disappears. So, in some cases it is treated correctly...
– Faekynn
2 hours ago
Maybe somebody else knows with a deeper understanding of the pgfplots interna...
– Faekynn
2 hours ago
@Faekynn I completely revised the answer. You only need to sayempty line=none.
– marmot
2 hours ago
|
show 2 more comments
To weed out empty rows you only need to say empty line=none, see p. 45 of the manual.
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents*}{data1.txt}
0 0
1 1
end{filecontents*}
begin{filecontents*}{data2.txt}
0 0
1 1
end{filecontents*}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black,empty line=none] table[x index =0, y index = 1] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
To weed out empty rows you only need to say empty line=none, see p. 45 of the manual.
documentclass[]{standalone}
usepackage{pgfplots,pgfplotstable}
pgfplotsset{compat=newest}
begin{filecontents*}{data1.txt}
0 0
1 1
end{filecontents*}
begin{filecontents*}{data2.txt}
0 0
1 1
end{filecontents*}
begin{document}
begin{tikzpicture}
begin{axis}
addplot [color=black,empty line=none] table[x index =0, y index = 1] {./data1.txt};
addplot [color=red,very thick,dashed] table[x index =0, y index = 1] {./data2.txt};
end{axis}
end{tikzpicture}
end{document}
edited 2 hours ago
answered 2 hours ago
marmotmarmot
122k6160300
122k6160300
Oh i know. (I tried to mention in the text that this works). But for large data it is not very practical. (The manual says the macro version is slower from 200 entries on)
– Faekynn
2 hours ago
@Faekynn Oh, sorry, I misread this. Then I do not know an answer but personally I feel that, if you want to deal with huge data sets and want to have high performance, you may want to weed these empty lines out with some faster tools like perl or something of that sort.
– marmot
2 hours ago
Perl, sed and so are of course possible, but not that portable. I guess it should be possible though: writing justaddplot table {file}surprisingly works. Only once i add a plot option, the graph disappears. So, in some cases it is treated correctly...
– Faekynn
2 hours ago
Maybe somebody else knows with a deeper understanding of the pgfplots interna...
– Faekynn
2 hours ago
@Faekynn I completely revised the answer. You only need to sayempty line=none.
– marmot
2 hours ago
|
show 2 more comments
Oh i know. (I tried to mention in the text that this works). But for large data it is not very practical. (The manual says the macro version is slower from 200 entries on)
– Faekynn
2 hours ago
@Faekynn Oh, sorry, I misread this. Then I do not know an answer but personally I feel that, if you want to deal with huge data sets and want to have high performance, you may want to weed these empty lines out with some faster tools like perl or something of that sort.
– marmot
2 hours ago
Perl, sed and so are of course possible, but not that portable. I guess it should be possible though: writing justaddplot table {file}surprisingly works. Only once i add a plot option, the graph disappears. So, in some cases it is treated correctly...
– Faekynn
2 hours ago
Maybe somebody else knows with a deeper understanding of the pgfplots interna...
– Faekynn
2 hours ago
@Faekynn I completely revised the answer. You only need to sayempty line=none.
– marmot
2 hours ago
Oh i know. (I tried to mention in the text that this works). But for large data it is not very practical. (The manual says the macro version is slower from 200 entries on)
– Faekynn
2 hours ago
Oh i know. (I tried to mention in the text that this works). But for large data it is not very practical. (The manual says the macro version is slower from 200 entries on)
– Faekynn
2 hours ago
@Faekynn Oh, sorry, I misread this. Then I do not know an answer but personally I feel that, if you want to deal with huge data sets and want to have high performance, you may want to weed these empty lines out with some faster tools like perl or something of that sort.
– marmot
2 hours ago
@Faekynn Oh, sorry, I misread this. Then I do not know an answer but personally I feel that, if you want to deal with huge data sets and want to have high performance, you may want to weed these empty lines out with some faster tools like perl or something of that sort.
– marmot
2 hours ago
Perl, sed and so are of course possible, but not that portable. I guess it should be possible though: writing just
addplot table {file} surprisingly works. Only once i add a plot option, the graph disappears. So, in some cases it is treated correctly...– Faekynn
2 hours ago
Perl, sed and so are of course possible, but not that portable. I guess it should be possible though: writing just
addplot table {file} surprisingly works. Only once i add a plot option, the graph disappears. So, in some cases it is treated correctly...– Faekynn
2 hours ago
Maybe somebody else knows with a deeper understanding of the pgfplots interna...
– Faekynn
2 hours ago
Maybe somebody else knows with a deeper understanding of the pgfplots interna...
– Faekynn
2 hours ago
@Faekynn I completely revised the answer. You only need to say
empty line=none.– marmot
2 hours ago
@Faekynn I completely revised the answer. You only need to say
empty line=none.– marmot
2 hours ago
|
show 2 more comments
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488286%2fempty-line-treatment-when-reading-tables-in-pgfplots%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown