Historique des modifications [retour]
cliquez ici pour masquer/afficher la révision 7
mineure typo & lien

26 Fév '19, 00:27

Pathe's gravatar image

Pathe
7.6k49208252

On peut ajouter une légende avec `\legend{entry1, entry2, ...}`, mais décaler les courbes est un petit peu plus compliqué : \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.16} \colorlet{bleuturquoise}{cyan} \usepackage{siunitx} \usepackage{filecontents} \begin{filecontents*}{test.txt} 1 2 10 4 100 2 1000 1 \end{filecontents*} \begin{document} \begingroup \centering \begin{tikzpicture} \begin{axis}[ title={Taille des particules de F127 pour $c_{m} = \SI{20}{g.L^{-1}}$ pour différents mélanges eau:THF}, xlabel={taille (nm)}, xmode=log, ylabel={intensité (u.a.)}, ymax=50, mark size=0.5pt, width=1\textwidth, legend style={at={(0.5,-0.15)},anchor=north}, legend columns=5, ] \addplot [red,thick,smooth] table {test.txt}; \addplot [purple,thick,smooth] table[x index = 0, y expr={\thisrowno{1} + 6}] {test.txt}; \addplot [blue,thick,smooth] table[x index = 0, y expr={\thisrowno{1} + 12}] {test.txt}; \addplot [bleuturquoise,thick,smooth] table[x index = 0, y expr={\thisrowno{1} + 18}] {test.txt}; \addplot [black,thick,smooth] table[x index = 0, y expr={\thisrowno{1} + 24}] {test.txt}; \legend{$d=2$,$d=3$,$d=4$,$d=5$,$d=6$}, \end{axis} \end{tikzpicture} \endgroup \end{document} ![alt text][1] <img src="/upfiles/Screen_Shot_2019-02-25_at_17.09.14.png" style="width: 100%;"/> Sans rapport avec le problème, je suggère d'utiliser l'extension `siunitx` pour obtenir des unités correctement. Ils devraient être non italique. [1]: https://texnique.fr/osqa/upfiles/Screen_Shot_2019-02-25_at_17.09.14.pngen [romain](https://fr.wikipedia.org/wiki/Romain_(typographie)).
cliquez ici pour masquer/afficher la révision 6

25 Fév '19, 21:31

samcarter's gravatar image

samcarter
8.6k2817

On peut ajouter une légende avec `\legend{entry1, entry2, ...}`, mais décaler les courbes est un petit peu plus compliqué : \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.16} \colorlet{bleuturquoise}{cyan} \usepackage{siunitx} \usepackage{filecontents} \begin{filecontents*}{test.txt} 1 2 10 4 100 2 1000 1 \end{filecontents*} \begin{document} \begingroup \centering \begin{tikzpicture} \begin{axis}[ title={Taille des particules de F127 pour $c_{m} = \SI{20}{g.L^{-1}}$ pour différents mélanges eau:THF}, xlabel={taille (nm)}, xmode=log, ylabel={intensité (u.a.)}, ymax=50, mark size=0.5pt, width=1\textwidth, legend style={at={(0.5,-0.15)},anchor=north}, legend columns=5, ] \addplot [red,thick,smooth] table {test.txt}; \addplot [purple,thick,smooth] table[x index = 0, y expr={\thisrowno{1} + 6}] {test.txt}; \addplot [blue,thick,smooth] table[x index = 0, y expr={\thisrowno{1} + 12}] {test.txt}; \addplot [bleuturquoise,thick,smooth] table[x index = 0, y expr={\thisrowno{1} + 18}] {test.txt}; \addplot [black,thick,smooth] table[x index = 0, y expr={\thisrowno{1} + 24}] {test.txt}; \legend{$d=2$,$d=3$,$d=4$,$d=5$,$d=6$}, \end{axis} \end{tikzpicture} \endgroup \end{document} ![alt text][1] Sans rapport avec le problème, je suggère d'utiliser l'extension `siunitx` pour obtenir des unités correctement. Ils devraient être non italique. [1]: https://texnique.fr/osqa/upfiles/Screen_Shot_2019-02-25_at_17.09.14.png
cliquez ici pour masquer/afficher la révision 5

25 Fév '19, 21:27

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 4

25 Fév '19, 21:13

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 3

25 Fév '19, 21:09

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 2

25 Fév '19, 21:07

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 1

25 Fév '19, 21:06

samcarter's gravatar image

samcarter
8.6k2817

C'est votre première visite ici ? Consultez la FAQ !

×