Historique des modifications [retour]
cliquez ici pour masquer/afficher la révision 15
mineure

21 Fév '19, 23:26

Pathe's gravatar image

Pathe
7.6k49209252

On pourrait utiliser `yshift=<...>`. Sans rapport avec le problème : : - Au au lieu de `\begin{center} ... \end{center}`, je suggère `\centering` pour éviter l'espace supplémentaire. - N'utilisez n'utilisez pas `$...$` pour texte comme `intensité`. Si vous voulez du texte en italique, utilisez `\textit{...}`. - Avec avec `0,1` vous obtenez un espacement incorrect. Utilisez `0{,}1` ou l'extension `icomma` --- \documentclass{article} \usepackage{tikz} \colorlet{bleuturquoise}{cyan} \usepackage{filecontents} \begin{filecontents*}{test.txt} 1 2 2 4 4 2 8 1 \end{filecontents*} \begin{document} \begingroup \centering \begin{tikzpicture} \draw[->,>=stealth][very thin](0,0)--(18.5,0); \draw (16.5,-1) node[right] {\textit{taille (nm)}}; \draw [->,>=stealth][very thick](0,0)--(0,9); \draw (0,9) node[above] {\textit{intensité (u.a.)}}; \draw (0,-0.2) node[below] {$0{,}1$}; \draw (3.5,-0.2) node[below] {$1$}; \draw (3.5,-0.1)--(3.5,0.1); \draw (7,-0.2) node[below] {$10$}; \draw (7,-0.1)--(7,0.1); \draw (10.5,-0.2) node[below] {$100$}; \draw (10.5,-0.1)--(10.5,0.1); \draw (14,-0.2) node[below] {$1000$}; \draw (14,-0.1)--(14,0.1); \draw (17.5,-0.2) node[below] {$10000$}; \draw (17.5,-0.1)--(17.5,0.1); \draw (-0.1,0) node[left] {$0$}; \draw (-0.1,1) node[left] {$2$}; \draw(-0.1,1)--(0.1,1); \draw (-0.1,2) node[left] {$4$}; \draw(-0.1,2)--(0.1,2); \draw (-0.1,3) node[left] {$6$}; \draw(-0.1,3)--(0.1,3); \draw (-0.1,4) node[left] {$8$}; \draw(-0.1,4)--(0.1,4); \draw (-0.1,5) node[left] {$10$}; \draw(-0.1,5)--(0.1,5); \draw (-0.1,6) node[left] {$12$}; \draw(-0.1,6)--(0.1,6); \draw (-0.1,7) node[left] {$14$}; \draw(-0.1,7)--(0.1,7); \draw (-0.1,8) node[left] {$16$}; \draw(-0.1,8)--(0.1,8); \draw[thick,smooth,color=red,yshift=0cm] plot file {test.txt}; \draw[thick,smooth,color=purple,yshift=2cm] plot file {test.txt}; \draw[thick,smooth,color=blue,yshift=4cm] plot file {test.txt}; \draw[thick,smooth,color=bleuturquoise,yshift=6cm] plot file {test.txt}; \draw[thick,smooth,color=black,yshift=8cm] plot file {test.txt}; \end{tikzpicture} \endgroup \end{document} ![alt text][1] ----- Une autre solution avec l'extension `pgfplots` (ça va faire dessiner automatiquement les axe) axes) : \documentclass{article} \usepackage{pgfplots} \colorlet{bleuturquoise}{cyan} \usepackage{filecontents} \begin{filecontents*}{test.txt} 1 2 10 4 100 2 1000 1 \end{filecontents*} \begin{document} \begingroup \centering \begin{tikzpicture} \begin{axis}[ xlabel={taille (nm)}, ylabel={intensité (u.a.)}, axis lines=left, ymax=12, xmode=log, log ticks with fixed point, ] \addplot [red,thick,smooth] table {test.txt}; \addplot [purple,thick,smooth,yshift=1cm] table {test.txt}; \addplot [blue,thick,smooth,yshift=2cm] table {test.txt}; \addplot [bleuturquoise,thick,smooth,yshift=3cm] table {test.txt}; \addplot [black,thick,smooth,yshift=4cm] table {test.txt}; \end{axis} \end{tikzpicture} \endgroup \end{document} ![alt text][2] [1]: https://texnique.fr/osqa/upfiles/Screen_Shot_2019-02-21_at_17.07.13.png [2]: https://texnique.fr/osqa/upfiles/Screen_Shot_2019-02-21_at_17.56.03.png
cliquez ici pour masquer/afficher la révision 14

21 Fév '19, 22:05

samcarter's gravatar image

samcarter
8.6k2817

On pourrait utiliser `yshift=<...>`. Sans rapport avec le problème : - Au lieu de `\begin{center} ... \end{center}`, je suggère `\centering` pour éviter l'espace supplémentaire. - N'utilisez pas `$...$` pour texte comme `intensité`. Si vous voulez du texte en italique, utilisez `\textit{...}`. - Avec `0,1` vous obtenez un espacement incorrect. Utilisez `0{,}1` ou l'extension `icomma` --- \documentclass{article} \usepackage{tikz} \colorlet{bleuturquoise}{cyan} \usepackage{filecontents} \begin{filecontents*}{test.txt} 1 2 2 4 4 2 8 1 \end{filecontents*} \begin{document} \begingroup \centering \begin{tikzpicture} \draw[->,>=stealth][very thin](0,0)--(18.5,0); \draw (16.5,-1) node[right] {\textit{taille (nm)}}; \draw [->,>=stealth][very thick](0,0)--(0,9); \draw (0,9) node[above] {\textit{intensité (u.a.)}}; \draw (0,-0.2) node[below] {$0{,}1$}; \draw (3.5,-0.2) node[below] {$1$}; \draw (3.5,-0.1)--(3.5,0.1); \draw (7,-0.2) node[below] {$10$}; \draw (7,-0.1)--(7,0.1); \draw (10.5,-0.2) node[below] {$100$}; \draw (10.5,-0.1)--(10.5,0.1); \draw (14,-0.2) node[below] {$1000$}; \draw (14,-0.1)--(14,0.1); \draw (17.5,-0.2) node[below] {$10000$}; \draw (17.5,-0.1)--(17.5,0.1); \draw (-0.1,0) node[left] {$0$}; \draw (-0.1,1) node[left] {$2$}; \draw(-0.1,1)--(0.1,1); \draw (-0.1,2) node[left] {$4$}; \draw(-0.1,2)--(0.1,2); \draw (-0.1,3) node[left] {$6$}; \draw(-0.1,3)--(0.1,3); \draw (-0.1,4) node[left] {$8$}; \draw(-0.1,4)--(0.1,4); \draw (-0.1,5) node[left] {$10$}; \draw(-0.1,5)--(0.1,5); \draw (-0.1,6) node[left] {$12$}; \draw(-0.1,6)--(0.1,6); \draw (-0.1,7) node[left] {$14$}; \draw(-0.1,7)--(0.1,7); \draw (-0.1,8) node[left] {$16$}; \draw(-0.1,8)--(0.1,8); \draw[thick,smooth,color=red,yshift=0cm] plot file {test.txt}; \draw[thick,smooth,color=purple,yshift=2cm] plot file {test.txt}; \draw[thick,smooth,color=blue,yshift=4cm] plot file {test.txt}; \draw[thick,smooth,color=bleuturquoise,yshift=6cm] plot file {test.txt}; \draw[thick,smooth,color=black,yshift=8cm] plot file {test.txt}; \end{tikzpicture} \endgroup \end{document} ![alt text][1] ----- Une autre solution avec l'extension `pgfplots` (ça va faire automatiquement les axe) : \documentclass{article} \usepackage{pgfplots} \colorlet{bleuturquoise}{cyan} \usepackage{filecontents} \begin{filecontents*}{test.txt} 1 2 10 4 100 2 1000 1 \end{filecontents*} \begin{document} \begingroup \centering \begin{tikzpicture} \begin{axis}[ xlabel={taille (nm)}, ylabel={intensité (u.a.)}, axis lines=left, ymax=12, xmode=log, log ticks with fixed point, ] \addplot [red,thick,smooth] table {test.txt}; \addplot [purple,thick,smooth,yshift=1cm] table {test.txt}; \addplot [blue,thick,smooth,yshift=2cm] table {test.txt}; \addplot [bleuturquoise,thick,smooth,yshift=3cm] table {test.txt}; \addplot [black,thick,smooth,yshift=4cm] table {test.txt}; \end{axis} \end{tikzpicture} \endgroup \end{document} ![alt text][2] [1]: https://texnique.fr/osqa/upfiles/Screen_Shot_2019-02-21_at_17.07.13.png [2]: https://texnique.fr/osqa/upfiles/Screen_Shot_2019-02-21_at_17.56.03.png
cliquez ici pour masquer/afficher la révision 13

21 Fév '19, 21:56

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 12

21 Fév '19, 21:54

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 11

21 Fév '19, 21:41

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 10

21 Fév '19, 21:38

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 9

21 Fév '19, 21:28

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 8

21 Fév '19, 21:22

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 7

21 Fév '19, 21:19

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 6

21 Fév '19, 21:17

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 5

21 Fév '19, 21:16

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 4

21 Fév '19, 21:11

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 3

21 Fév '19, 21:07

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 2

21 Fév '19, 21:07

samcarter's gravatar image

samcarter
8.6k2817

cliquez ici pour masquer/afficher la révision 1

21 Fév '19, 21:05

samcarter's gravatar image

samcarter
8.6k2817

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

×