- Questo topic ha 16 risposte, 5 partecipanti ed è stato aggiornato l'ultima volta 12 anni, 8 mesi fa da .
-
Topic
-
Salve volevo chiedervi un’aiuto nell’uso del pacchetto pgfplots. Volevo realizzare un’istruzione in modo da richiamare attraverso un ciclo “foreach” venti file che ho collocato in una cartella /dati/beta. I file si chiamano “1.dat”, “2.dat”, …, “20.dat”. Il file viene compilato e in output ottengo il file PDF solo che ricevo un’errore che allego alla fine. Inoltre vi volevo chiedere se è possibile realizzare con lo stesso ciclo un’etichettatura del tipo “theta=1°”, “theta=2°”,…, “theta=20°” e realizzare al contempo magari un tratteggio o un colore diverso per ogni curva.
Codice impostato:
`\documentclass[12pt,titlepage,oneside]{book}
\usepackage{pgfplots,pgfplotstable,relsize}
…
\pgfplotsset{width=10cm, height=7cm, no markers, scale only axis}
\pgfplotsset{every axis x label/.append style={ font=\relsize{.1},yshift=-.7em},every axis y label/.append style={font=\relsize{.1},rotate=-90,xshift=-.7em}}
\pgfkeys{/pgf/number format/.cd,set thousands separator={}}
…
\begin{figure}
\begin{center}
\begin{tikzpicture}
\begin{axis}[grid, xlabel={$M_1$ [-]}, ylabel={$\beta$ [\si{\degree}]}]
\foreach \i in {1,2,3,…,20}
\addplot table {dati/beta/\i.dat};
\end{axis}
\end{tikzpicture}
\caption{Angolo d'urto in funzione del numero di Mach a monte dell'onda d'urto al variare dell'angolo $\theta$}
\label{fig:beta}
\end{center}
\end{figure}
`
Errore:
`./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/1.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.PGFPlots: reading {dati/beta/1.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/2.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
(That was another \errmessage.)
PGFPlots: reading {dati/beta/2.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/3.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
(That was another \errmessage.)
PGFPlots: reading {dati/beta/3.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/4.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
(That was another \errmessage.)
PGFPlots: reading {dati/beta/4.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/5.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
(That was another \errmessage.)
PGFPlots: reading {dati/beta/5.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/6.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
(That was another \errmessage.)
PGFPlots: reading {dati/beta/6.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/7.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
(That was another \errmessage.)
PGFPlots: reading {dati/beta/7.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/8.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
(That was another \errmessage.)
PGFPlots: reading {dati/beta/8.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
./Main.tex:151: Package pgfplots Error: Could not read table file 'dati/beta/9.
dat'. In case you intended to provide inline data: maybe TeX screwed up your en
d-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the
pgfplotstable manual for details).See the pgfplots package documentation for explanation.
Type Hfor immediate help.
…l.151 …ne width=1.2pt] table {dati/beta/\i.dat};
(That was another \errmessage.)
PGFPlots: reading {dati/beta/9.dat}
Package pgfplots Warning: the current plot has no coordinates (or all have been
filtered away) on input line 151.[warning /pgfplots/warning/plot without coordinates]
PGFPlots: reading {dati/beta/10.dat}
PGFPlots: reading {dati/beta/11.dat}
PGFPlots: reading {dati/beta/12.dat}
PGFPlots: reading {dati/beta/13.dat}
PGFPlots: reading {dati/beta/14.dat}
PGFPlots: reading {dati/beta/15.dat}
PGFPlots: reading {dati/beta/16.dat}
PGFPlots: reading {dati/beta/17.dat}
PGFPlots: reading {dati/beta/18.dat}
PGFPlots: reading {dati/beta/19.dat}
PGFPlots: reading {dati/beta/20.dat}
LaTeX Font Info: Try loading font information for T1+lmss on input line 154.(/usr/local/texlive/2013/texmf-dist/tex/latex/lm/t1lmss.fd
File: t1lmss.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
LaTeX Font Info: External font `lmex10' loaded for size
(Font) <10.95> on input line 154.
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 159.
[1{/usr/local/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map} <./UNINA .pdf>]
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 14.49998pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.[2]
Package atveryend Info: Empty hook `AfterLastShipout' on input line 159.
(./Main.aux)
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 159.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 159.Package rerunfilecheck Warning: File `Main.out' has changed.
(rerunfilecheck) Rerun to get outlines right
(rerunfilecheck) or use package `bookmark'.Package rerunfilecheck Info: Checksums for `Main.out':
(rerunfilecheck) Before:
(rerunfilecheck) After: D41D8CD98F00B204E9800998ECF8427E;0.LaTeX Font Warning: Some font shapes were not available, defaults substituted.
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
)
Here is how much of TeX's memory you used:
36081 strings out of 493308
792660 string characters out of 6137815
936016 words of memory out of 5000000
38816 multiletter control sequences out of 15000+600000
59242 words of font info for 54 fonts, out of 8000000 for 9000
957 hyphenation exceptions out of 8191
63i,11n,74p,10461b,2363s stack positions out of 5000i,500n,10000p,200000b,80000s
{/usr/local/texlive/2013/texmf-dist/fonts/enc/dvips/lm/lm-mathit.enc}{/usr/lo
cal/texlive/2013/texmf-dist/fonts/enc/dvips/lm/lm-ec.enc}{/usr/local/texlive/20
13/texmf-dist/fonts/enc/dvips/lm/lm-mathsy.enc}{/usr/local/texlive/2013/texmf-d
ist/fonts/enc/dvips/lm/lm-rm.enc}
Output written on Main.pdf (2 pages, 653970 bytes).
PDF statistics:
68 PDF objects out of 1000 (max. 8388607)
51 compressed objects within 1 object stream
4 named destinations out of 1000 (max. 500000)
18 words of extra memory for PDF output out of 10000 (max. 10000000)
`Il grafico che ottengo:

Buon natale a tutti!!!!!!!
- Devi essere connesso per rispondere a questo topic.

