Re: Ordine coordinate in \addplot con Pgfplots

#95317
franen
Partecipante
    Up
    0
    Down
    ::


    `\documentclass{standalone}
    \usepackage{pgfplots, pgfplotstable}

    \usepackage{filecontents}
    \begin{filecontents}{testdata.dat}
    x y
    -0.000177758 932.835
    -0.000139915 933.099
    -1.41E-005 934.237
    -0.000108379 933.347
    -8.21E-005 933.574
    -6.02E-005 933.776
    -4.20E-005 933.954
    -2.67E-005 934.107
    -3.51E-006 934.345
    3.43E-013 934.385
    \end{filecontents}

    \pgfplotstablesort{\sorted}{testdata.dat}

    \begin{document}
    \begin{tikzpicture}
    \begin{axis}
    \addplot table {\sorted};
    \end{axis}
    \end{tikzpicture}
    \end{document}`
    Funziona tutto! (io ho sostituito le virgole con i punti, ma con pgfplots c’è il modo di usare anche le vorgole (solo che facevo prima così, senza andare a cercare…).

    Ho avuto anche io esperienze col comando sort di windows, solo che ha il difetto di ordinare i numeri come 1,11,2,21,3,…

    Fran

    Go to top