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

14 Mar '21, 14:40

stefan's gravatar image

stefan
10618

**À compléter** Une solution basée sur [pgfplots](https://www.ctan.org/pkg/pgfplots). L'idée et d'ajouter (dans le fichier des données) une troisième colonne `(xy)` qui contient les coordonnées `(x,y)` de chaque point. **Exemple** fichier des données `SpFermat.dat` #x y (xy) 0.000000000000000000 0.000000000000000000 (0.00,0.00) -0.518802039868240988 0.475261237035540361 (-0.52,0.48) 0.086998192061317269 -0.991205788208514315 (0.09,-0.99) 0.741456721985263832 0.967123740491808607 (0.74,0.97) -1.385650965711109962 -0.245125684545435452 (-1.39,-0.25) 1.327463029854904571 -0.844384926658710952 (1.33,-0.84) -0.447448095958092837 1.664320582527139602 (-0.45,1.66) -0.857933200213072615 -1.652014595568742482 (-0.86,-1.65) ... Les mots clés sont `nodes near coords={\tiny \pgfplotspointmeta}` et `point meta=explicit symbolic`. **Exemple** fichier `.tex` \begin{filecontents}{SpFermat.dat} #x y (xy) 0.000000000000000000 0.000000000000000000 (0.00,0.00) -0.518802039868240988 0.475261237035540361 (-0.52,0.48) 0.086998192061317269 -0.991205788208514315 (0.09,-0.99) 0.741456721985263832 0.967123740491808607 (0.74,0.97) -1.385650965711109962 -0.245125684545435452 (-1.39,-0.25) 1.327463029854904571 -0.844384926658710952 (1.33,-0.84) -0.447448095958092837 1.664320582527139602 (-0.45,1.66) -0.857933200213072615 -1.652014595568742482 (-0.86,-1.65) \end{filecontents} \documentclass{article} \usepackage[a4paper,margin=1cm]{geometry} \usepackage{pgfplots} \pagestyle{empty} \begin{document} \begin{tikzpicture}[>=latex] \begin{axis}[nodes near coords={\tiny \pgfplotspointmeta}, width=20cm, height=20cm, axis lines=center, xlabel style={below right}, ylabel style={above left}, xlabel={$x$}, ylabel={$y$}, xtick={-10,-9,...,10}, ytick={-10,-9,...,10}, xmin=-10.5, xmax=10.5, ymin=-10.5, ymax=10.5] \addplot[mark=ball, only marks, point meta=explicit symbolic] file {SpFermat.dat}; \end{axis} \end{tikzpicture} \end{document}\end{document}
cliquez ici pour masquer/afficher la révision 4

18 Mar '17, 22:27

touhami's gravatar image

touhami
10.0k410

**À compléter** Une solution basée sur [pgfplots](https://www.ctan.org/pkg/pgfplots) et ([fp](https://www.ctan.org/pkg/fp) pour les calculs). [pgfplots](https://www.ctan.org/pkg/pgfplots). L'idée et d'ajouter (dans le fichier des données) une troisième colonne `(xy)` qui contient les coordonnées `(x,y)` de chaque point. **Exemple** fichier des données `SpFermat.dat` #x y (xy) 0.000000000000000000 0.000000000000000000 (0.00,0.00) -0.518802039868240988 0.475261237035540361 (-0.52,0.48) 0.086998192061317269 -0.991205788208514315 (0.09,-0.99) 0.741456721985263832 0.967123740491808607 (0.74,0.97) -1.385650965711109962 -0.245125684545435452 (-1.39,-0.25) 1.327463029854904571 -0.844384926658710952 (1.33,-0.84) -0.447448095958092837 1.664320582527139602 (-0.45,1.66) -0.857933200213072615 -1.652014595568742482 (-0.86,-1.65) ... Les mots clés sont `nodes near coords={\tiny \pgfplotspointmeta}` et `point meta=explicit symbolic`. **Exemple** fichier `.tex` \documentclass{article} \usepackage[a4paper,margin=1cm]{geometry} \usepackage{pgfplots} \usepackage{fp} \pagestyle{empty} \begin{document} %---------------------------------------------------- % cette partie n'est pas essentielle % il s'agit de montrer comment utiliser (La)TeX pour % créer le fichier des données. On peut utiliser % un outil externe. %---------------------------------------------------- \def\mtspace{\space\space\space} \def\datefile{SpFermat.dat} \IfFileExists{\datefile}{}{% %le fichier n'existe pas, on le crée \newwrite\foo \immediate\openout\foo=\datefile \immediate\write\foo{##x \mtspace y \mtspace (xy)} \foreach \n in {0,...,112} {% \FPeval\mtx{.06*root(2,(137.508)*\n)*cos((137.508)*\n)}% \FPeval\mty{.06*root(2,(137.508)*\n)*sin((137.508)*\n)}% \FPeval\lmtx{round(\mtx:2)}% \FPeval\lmty{round(\mty:2)}% \immediate\write\foo{\mtx\mtspace\mty\mtspace(\lmtx,\lmty)}} \immediate\closeout\foo} %---------------------------------------------------- \begin{tikzpicture}[>=latex] \begin{axis}[nodes near coords={\tiny \pgfplotspointmeta}, width=20cm, height=20cm, axis lines=center, xlabel style={below right}, ylabel style={above left}, xlabel={$x$}, ylabel={$y$}, xtick={-10,-9,...,10}, ytick={-10,-9,...,10}, xmin=-10.5, xmax=10.5, ymin=-10.5, ymax=10.5] \addplot[mark=ball, only marks, point meta=explicit symbolic] file {\datefile}; {SpFermat.dat}; \end{axis} \end{tikzpicture} \end{document} ![alt text][1] **Question** Avec la commande `\addplot[mark=ball, smooth, point meta=explicit symbolic] file {\datefile};` j'obtient le résultat suivant. Est ce que j'ai bien? ![alt text][2] [1]: http://texnique.fr:80/osqa/upfiles/2017-03-12_16_48_07-ffnn.pdf.png [2]: http://texnique.fr:80/osqa/upfiles/2017-03-12_16_39_05-ffnn.pdf.png\end{document}
cliquez ici pour masquer/afficher la révision 3
mineure

13 Mar '17, 01:51

Pathe's gravatar image

Pathe
7.6k52210254

cliquez ici pour masquer/afficher la révision 2

12 Mar '17, 19:49

touhami's gravatar image

touhami
10.0k410

cliquez ici pour masquer/afficher la révision 1

12 Mar '17, 19:11

touhami's gravatar image

touhami
10.0k410