Je trace une courbe d'après un tableau de valeurs, mais le problême est que la courbe est étroite à côté du zéro, et je sais pas comment élargir la courbe. Voici un ECM : \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel={Energy MeV }, % Nom de l'axe des x ylabel={Stopping Power \textbf{$MeV.cm^2/mg$}}, xmin=0,xmax=10,ymode=log, grid=both, legend style={at={(0.5,1.12)}, anchor=north}, ] \addplot[magenta,mark=*,line width=0.7pt,mark size=0.5] coordinates { (0.01, 0.4283) (0.011, 0.448) (0.012, 0.4667) (0.013, 0.4845) (0.014, 0.5014) (0.015, 0.5176) (0.016, 0.533) (0.017, 0.5478) (0.018, 0.562) (0.02, 0.5886) (0.0225, 0.6189) (0.025, 0.6463) (0.0275, 0.671) (0.03, 0.6934) (0.0325, 0.7135) (0.035, 0.7317) (0.0375, 0.748) (0.04, 0.7626) (0.045, 0.7871) (0.05, 0.8063) (0.055, 0.8207) (0.06, 0.8312) (0.065, 0.8382) (0.07, 0.8422) (0.08, 0.8431) (0.09, 0.8367) (0.1, 0.8252) (0.11, 0.8102) (0.12, 0.7929) (0.13, 0.7743) (0.14, 0.755) (0.15, 0.7355) (0.16, 0.7161) (0.17, 0.6971) (0.18, 0.6787) (0.2, 0.6437) (0.225, 0.6041) (0.25, 0.5689) (0.275, 0.5377) (0.3, 0.51) (0.325, 0.4854) (0.35, 0.4634) (0.375, 0.4437) (0.4, 0.4258) (0.45, 0.3949) (0.5, 0.3691) (0.55, 0.3472) (0.6, 0.3283) (0.65, 0.3119) (0.7, 0.2976) (0.8, 0.2738) (0.9, 0.2551) (1, 0.2402) (1.1, 0.2328) (1.2, 0.2258) (1.3, 0.2162) (1.4, 0.2072) (1.5, 0.1989) (1.6, 0.1911) (1.7, 0.1838) (1.8, 0.1769) (2, 0.1643) (2.25, 0.1507) (2.5, 0.1392) (2.75, 0.1294) (3, 0.121) (3.25, 0.1138) (3.5, 0.1074) (3.75, 0.1017) (4, 0.09673) (4.5, 0.08818) (5, 0.08114) (5.5, 0.07523) (6, 0.0702) (6.5, 0.06586) (7, 0.06207) (8, 0.05576) (9, 0.05071) (10, 0.04657) }; \addlegendentry{Courbe 1} \end{axis} \end{tikzpicture} \end{document} Posée 04 Déc '23, 15:15 Elaarfaoui Pathe ♦♦ |
Il suffit de spécifier la dimension souhaitée pour l'unité sur l'axe des abscisses. Voici un exemple avec une telle unité fixée à 1,2 cm pour la 1re figure, à comparer avec la 2e (qui est l'originale). \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel={Energy MeV }, % Nom de l'axe des x ylabel={Stopping Power \textbf{$MeV.cm^2/mg$}}, xmin=0,xmax=10,ymode=log, grid=both, x=1.2cm, legend style={at={(0.5,1.12)}, anchor=north}, ] \addplot[magenta,mark=*,line width=0.7pt,mark size=0.5] coordinates { (0.01, 0.4283) (0.011, 0.448) (0.012, 0.4667) (0.013, 0.4845) (0.014, 0.5014) (0.015, 0.5176) (0.016, 0.533) (0.017, 0.5478) (0.018, 0.562) (0.02, 0.5886) (0.0225, 0.6189) (0.025, 0.6463) (0.0275, 0.671) (0.03, 0.6934) (0.0325, 0.7135) (0.035, 0.7317) (0.0375, 0.748) (0.04, 0.7626) (0.045, 0.7871) (0.05, 0.8063) (0.055, 0.8207) (0.06, 0.8312) (0.065, 0.8382) (0.07, 0.8422) (0.08, 0.8431) (0.09, 0.8367) (0.1, 0.8252) (0.11, 0.8102) (0.12, 0.7929) (0.13, 0.7743) (0.14, 0.755) (0.15, 0.7355) (0.16, 0.7161) (0.17, 0.6971) (0.18, 0.6787) (0.2, 0.6437) (0.225, 0.6041) (0.25, 0.5689) (0.275, 0.5377) (0.3, 0.51) (0.325, 0.4854) (0.35, 0.4634) (0.375, 0.4437) (0.4, 0.4258) (0.45, 0.3949) (0.5, 0.3691) (0.55, 0.3472) (0.6, 0.3283) (0.65, 0.3119) (0.7, 0.2976) (0.8, 0.2738) (0.9, 0.2551) (1, 0.2402) (1.1, 0.2328) (1.2, 0.2258) (1.3, 0.2162) (1.4, 0.2072) (1.5, 0.1989) (1.6, 0.1911) (1.7, 0.1838) (1.8, 0.1769) (2, 0.1643) (2.25, 0.1507) (2.5, 0.1392) (2.75, 0.1294) (3, 0.121) (3.25, 0.1138) (3.5, 0.1074) (3.75, 0.1017) (4, 0.09673) (4.5, 0.08818) (5, 0.08114) (5.5, 0.07523) (6, 0.0702) (6.5, 0.06586) (7, 0.06207) (8, 0.05576) (9, 0.05071) (10, 0.04657) }; \addlegendentry{Courbe 1} \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ xlabel={Energy MeV }, % Nom de l'axe des x ylabel={Stopping Power \textbf{$MeV.cm^2/mg$}}, xmin=0,xmax=10,ymode=log, grid=both, legend style={at={(0.5,1.12)}, anchor=north}, ] \addplot[magenta,mark=*,line width=0.7pt,mark size=0.5] coordinates { (0.01, 0.4283) (0.011, 0.448) (0.012, 0.4667) (0.013, 0.4845) (0.014, 0.5014) (0.015, 0.5176) (0.016, 0.533) (0.017, 0.5478) (0.018, 0.562) (0.02, 0.5886) (0.0225, 0.6189) (0.025, 0.6463) (0.0275, 0.671) (0.03, 0.6934) (0.0325, 0.7135) (0.035, 0.7317) (0.0375, 0.748) (0.04, 0.7626) (0.045, 0.7871) (0.05, 0.8063) (0.055, 0.8207) (0.06, 0.8312) (0.065, 0.8382) (0.07, 0.8422) (0.08, 0.8431) (0.09, 0.8367) (0.1, 0.8252) (0.11, 0.8102) (0.12, 0.7929) (0.13, 0.7743) (0.14, 0.755) (0.15, 0.7355) (0.16, 0.7161) (0.17, 0.6971) (0.18, 0.6787) (0.2, 0.6437) (0.225, 0.6041) (0.25, 0.5689) (0.275, 0.5377) (0.3, 0.51) (0.325, 0.4854) (0.35, 0.4634) (0.375, 0.4437) (0.4, 0.4258) (0.45, 0.3949) (0.5, 0.3691) (0.55, 0.3472) (0.6, 0.3283) (0.65, 0.3119) (0.7, 0.2976) (0.8, 0.2738) (0.9, 0.2551) (1, 0.2402) (1.1, 0.2328) (1.2, 0.2258) (1.3, 0.2162) (1.4, 0.2072) (1.5, 0.1989) (1.6, 0.1911) (1.7, 0.1838) (1.8, 0.1769) (2, 0.1643) (2.25, 0.1507) (2.5, 0.1392) (2.75, 0.1294) (3, 0.121) (3.25, 0.1138) (3.5, 0.1074) (3.75, 0.1017) (4, 0.09673) (4.5, 0.08818) (5, 0.08114) (5.5, 0.07523) (6, 0.0702) (6.5, 0.06586) (7, 0.06207) (8, 0.05576) (9, 0.05071) (10, 0.04657) }; \addlegendentry{Courbe 1} \end{axis} \end{tikzpicture} \end{document} Publiée 04 Déc '23, 15:46 denis ♦♦ D'accord c'est bien. Merci bcp
(05 Déc '23, 21:31)
Elaarfaoui
@Elaarfaoui Attention ! Cette réponse était un commentaire plutôt qu'une réponse et a été convertie comme tel.
(05 Déc '23, 21:34)
denis ♦♦
@Elaarfaoui Attention ! Ce commentaire ne comporte qu'une confirmation de solution et c'est à éviter au profit de l'acceptation de la réponse la plus appropriée.
(05 Déc '23, 21:35)
denis ♦♦
@Elaarfaoui Attention ! Les formules de politesse et les signatures sont à éviter.
(05 Déc '23, 21:36)
denis ♦♦
|
Bienvenue sur TeXnique.fr !
@Elaarfaoui : bienvenue sur TeXnique.fr !