Saltar al contenido principal
LibreTexts Español

11.4: Trazado de datos

  • Page ID
    113223
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    Aquí hay algunos comandos preliminares para ejecutar si aún no lo han estado.

    using Pkg; Pkg.add("Plots")
       Updating registry at `/srv/julia/pkg/registries/General`
      Resolving package versions...
    No Changes to `~/Project.toml`
    No Changes to `~/Manifest.toml`
    

    Y para esta sección, tendremos que avisarle a julia para usar el paquete Parcelas:

    using Plots
     

    Vamos a querer producir gráficas de conjuntos de datos, comenzaremos con solo algunos datos aleatorios. A continuación se producen los valores 1 a 10 para x y enteros aleatorios entre 1 y 10 para y:

    x=1:10
    y=rand(1:10,10)
    10-element Array{Int64,1}:
     1
     6
     3
     4
     1
     3
     3
     9
     8
     1

    A continuación se producirá una gráfica de dispersión de los datos, donde cada punto se traza como un punto.

    scatter(x,y)

    Si quisiéramos que los datos fueran trazados con líneas que conectan los puntos, usamos el mismo comando plot que hicimos anteriormente.

    plot(x,y)

    y podemos trazar tanto puntos como líneas con:

    plot(x,y,seriestype=[:scatter,:line])

    11.4: Trazado de datos is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.