Está en la página 1de 2

The plots that I've shown to you in the previous Las tramas que te he mostrado en el video anterior y las

erior y las que


video and the ones you've created yourself te has creado
in the interactive exercises look quite nice, but there En los ejercicios interactivos se ven muy bien, pero sin duda
are certainly more things we can hay más cosas que podemos
do to make the plots fancier and more informative. Hacer para hacer las parcelas más lujoso y más informativo.
What about setting a title, or specifying ¿Qué hay de establecer un título o especificar
the labels of the axes? All of this is possible from Las etiquetas de los ejes? Todo esto es posible desde dentro
inside R. Throughout our experiments, de R. A lo largo de nuestros experimentos,
we will be using the `mercury` data frame, thats lists Usaremos el marco de datos de "mercurio", que enumera las
pressure versus temperature measurements mediciones de presión versus temperatura
of mercury. It contains two variables: temperature De mercurio. Contiene dos variables: temperatura y presión.
and pressure. Let's start with a simple plot: Comencemos con una simple trama:
We can clearly see that the pressure rises Podemos ver claramente que la presión aumenta
dramatically once the temperature exceeds dramáticamente una vez que la temperatura excede
200 degrees celsius. But this plot is still kind of dull, 200 grados centígrados. Pero esta trama sigue siendo un poco
isn't it? Have a look at this aburrida, ¿no? Echa un vistazo a esto
code, that specifies a bunch of arguments inside the , Que especifica un montón de argumentos dentro de la
`plot()` function. función `plot ()`.
The result looks like this. Can you tell which El resultado se ve así. ¿Puede usted decir qué argumentos
arguments led to which changes in the plot? llevaron a qué cambios en la trama?
`xlab` and `ylab` changed the horizontal and vertical `Xlab` y` ylab` cambiaron las etiquetas de los ejes horizontal y
axis labels, respectively, while vertical, respectivamente, mientras que
`main` specified the plot title. If you set the `type` `Main` especificó el título de la trama. Si establece el
argument to `o`, you will have argumento `type` en` o`, tendrá
both points and a line through these points on your Ambos puntos y una línea a través de estos puntos en su
plot. If you only want a line, you parcela. Si sólo quieres una línea,
can use type = "l", which looks like this: Puede usar type = "l", que se parece a esto:
Finally, the `col` argument specifies the plot color. Finalmente, el argumento `col` especifica el color de la trama.
Most of the arguments that are used here, such as La mayoría de los argumentos que se utilizan aquí, como
`xlab`, `ylab`, `main` and `type`, `xlab`,` ylab`, `main` y` type`,
are specified in the documentation of the `plot()` Se especifican en la documentación de la función `plot ()`. Sin
function. However, the `plot()` function embargo, la función `plot ()`
also allows you to set a bunch of other graphical También le permite establecer un montón de otros
parameters. An example of such a graphical parámetros gráficos. Un ejemplo de una
parameter is `col`, which specifies the color. But Parámetro es `col`, que especifica el color. Pero hay muchos
there are many others. otros.
You can specify these graphical parameters straight Puede especificar estos parámetros gráficos directamente
inside the `plot()` function, as dentro de la función `plot ()`, como
you did with `col`. In this case here, the graphical Lo hiciste con `col`. En este caso, el parámetro gráfico sólo
parameter only has an effect on tiene un efecto sobre
this specific graph. If you now plot the same graph, Este gráfico específico. Si ahora traza el mismo gráfico, sin el
without the col argument, the green argumento col, el campo verde
color is not there anymore. Color no está allí más.
You can also inspect and control these same También puede inspeccionar y controlar estos mismos
graphical parameters with the `par()` function. parámetros gráficos con la función `par ()`.
Typing question mark par opens up its Al escribir el signo de interrogación par abre su
documentation, with information on all the documentación, con información sobre todos los parámetros
parameters that que
you can specify. Simply calling `par()` gives you the Puede especificar. Simplemente llamando `par ()` le da los
actual values of these parameters. valores reales de estos parámetros.
You can also use `par()` with arguments to specify También puede usar `par ()` con argumentos para especificar
session-wide graphical parameters: los parámetros gráficos de toda la sesión:
Suppose you set the color to blue using the `par()` Supongamos que usted fija el color a azul usando la función
function, ..., and now create a plot. `par ()`, ..., y ahora crea una trama.
It's blue. If you next create another plot, ..., the plot Es azul. Si creas otra trama, ... ¡la trama sigue siendo azul! Eso
is still blue! That's because es porque
parameters specified with `par()` are maintained for Los parámetros especificados con `par ()` se mantienen para
different plotting operations. If you diferentes operaciones de trazado. Si tu
list all graphical parameters again and select the `col` Lista todos los parámetros gráficos de nuevo y seleccione el
element, ..., you'll see that indeed, elemento `col`, ..., verá que de hecho,
it's still set to blue. Todavía está fijado al azul.
For the rest of this video, let me focus on some of Para el resto de este video, permítanme concentrarme en
the most important graphical parameters. algunos de los parámetros gráficos más importantes.
I'll do this by adding arguments to the plot function, Lo haré añadiendo argumentos a la función plot, en lugar de
instead of using the par function usar la función par
for this. para esto.
You already know the first 5 graphical parameters. Ya conoce los primeros 5 parámetros gráficos. Similar al
Similar to the `col` argument, the `col.main` argumento `col`, el` col.main`
argument specifies the color of the main title. There Argumento especifica el color del título principal. También hay
are also other col dot arguments to otros argumentos col
set the color of other elements in your plot. Next, Establecer el color de otros elementos en su parcela. A
the `cex dot axis` argument specifies continuación, el argumento `cex dot axis` especifica
with which ratio the original font size of the axis tick Con qué relación se debe multiplicar el tamaño de fuente
marks should be multiplied. original de las marcas de escala del eje.
With cex dot axis equal 0.6, we have small labels, Con eje de punto cex igual 0,6, tenemos etiquetas pequeñas,
with cex.axis to 1.5, the labels become con cex.axis a 1,5, las etiquetas se convierten
huge. enorme.
Just as the col parameter has col dot variants for Así como el parámetro col tiene variantes de col puntos para
other elements in the plot, the cex parameter otros elementos de la gráfica, el parámetro cex
also has its cex dot variants. También tiene sus variantes de punto cex.
The `lty` argument specifies the line type. a line type El argumento `lty` especifica el tipo de línea. Un tipo de línea
of 1 is a full line, and the types de 1 es una línea completa, y los tipos
2 to 6 are all different types of lines, like you can see 2 a 6 son todos los diferentes tipos de líneas, como se puede
here. And last but not least, ver aquí. Y por último pero no menos importante,
we have the `pch` argument, which specifies a plot Tenemos el argumento `pch`, que especifica un símbolo de
symbol for the points you are plotting. trazado para los puntos que está trazando.
There are more than 35 different symbols for Hay más de 35 símbolos diferentes para trazar, pasando de los
plotting, going from plusses and small octogonals plusses y octogonales pequeños
to stars and hashtags. A las estrellas y hashtags.
Like I said, all of these arguments are just the tip of Como he dicho, todos estos argumentos son sólo la punta del
the iceberg. One of R's main powers iceberg. Una de las principales potencias de R
is visualization and this is clear from the numerous Es la visualización y esto está claro de las numerosas maneras
ways in which you can make your plots en que usted puede hacer sus parcelas
ready for a report. Just make sure you don't overdo Listo para un informe. Sólo asegúrese de no exagerar las
things; interpretability should be cosas; Interpretabilidad debe ser
the main goal at all times! El objetivo principal en todo momento!
L
Definiciones de l
Duodécima letra del alfabeto español; representa una
consonante alveolar, lateral y sonora. Su nombre es ele.
Signo que en la numeración romana equivale a cincuenta.

También podría gustarte