{"id":3513,"date":"2023-03-08T09:56:51","date_gmt":"2023-03-08T09:56:51","guid":{"rendered":"https:\/\/ricovictor.com\/?p=3513"},"modified":"2023-03-08T15:15:09","modified_gmt":"2023-03-08T15:15:09","slug":"anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13","status":"publish","type":"post","link":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/","title":{"rendered":"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3513\" class=\"elementor elementor-3513\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a9cc75c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a9cc75c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-27c67ed\" data-id=\"27c67ed\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e3ebead elementor-widget elementor-widget-text-editor\" data-id=\"e3ebead\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>En este tutorial aprenderemos a a\u00f1adir leyendas y personalizarlas en gr\u00e1ficos de R. En este caso usaremos la funci\u00f3n \u00ablegend\u00bb para hacer algunos ejemplos. <strong>Abajo tienes el c\u00f3digo en R del video( Descarga los datos que usan en el tutorial aqu\u00ed)<\/strong><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-e7bb584 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"e7bb584\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3833307\" data-id=\"3833307\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d0feb21 elementor-widget elementor-widget-video\" data-id=\"d0feb21\" data-element_type=\"widget\" data-settings=\"{&quot;youtube_url&quot;:&quot;https:\\\/\\\/youtu.be\\\/HiuZNdkMYPA&quot;,&quot;video_type&quot;:&quot;youtube&quot;,&quot;controls&quot;:&quot;yes&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-wrapper elementor-open-inline\">\n\t\t\t<div class=\"elementor-video\"><\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-28548845 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"28548845\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4fc67d1\" data-id=\"4fc67d1\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-309aca50 elementor-widget elementor-widget-text-editor\" data-id=\"309aca50\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><!-- wp:paragraph --><\/p>\n<p>DATOS Y C\u00d3DIGO EN R<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:file {\"id\":3517,\"href\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_argentina.csv\"} --><\/p>\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-9aa419ac-a999-476f-bb43-b8ce0227d8c0\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_argentina.csv\">pib_per_capita_argentina<\/a><a class=\"wp-block-file__button wp-element-button\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_argentina.csv\" download=\"\" aria-describedby=\"wp-block-file--media-9aa419ac-a999-476f-bb43-b8ce0227d8c0\">Descarga<\/a><\/div>\n<p><!-- \/wp:file --><\/p>\n<p><!-- wp:file {\"id\":3518,\"href\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_chile.csv\"} --><\/p>\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-57bb9a9a-ff83-4655-a821-05de2aca6aa4\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_chile.csv\">pib_per_capita_chile<\/a><a class=\"wp-block-file__button wp-element-button\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_chile.csv\" download=\"\" aria-describedby=\"wp-block-file--media-57bb9a9a-ff83-4655-a821-05de2aca6aa4\">Descarga<\/a><\/div>\n<p><!-- \/wp:file --><\/p>\n<p><!-- wp:file {\"id\":3519,\"href\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_espana.csv\"} --><\/p>\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-6b207124-5e7f-45f7-b1eb-8a36d7132a1e\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_espana.csv\">pib_per_capita_espa\u00f1a<\/a><a class=\"wp-block-file__button wp-element-button\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_espana.csv\" download=\"\" aria-describedby=\"wp-block-file--media-6b207124-5e7f-45f7-b1eb-8a36d7132a1e\">Descarga<\/a><\/div>\n<p><!-- \/wp:file --><\/p>\n<p><!-- wp:file {\"id\":3520,\"href\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_mexico.csv\"} --><\/p>\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-637ffdd5-425a-4a0a-bb81-c74c99643332\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_mexico.csv\">pib_per_capita_mexico<\/a><a class=\"wp-block-file__button wp-element-button\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/pib_per_capita_mexico.csv\" download=\"\" aria-describedby=\"wp-block-file--media-637ffdd5-425a-4a0a-bb81-c74c99643332\">Descarga<\/a><\/div>\n<p><!-- \/wp:file --><\/p>\n<p><!-- wp:file {\"id\":3521,\"href\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/poblacion_mexico.csv\"} --><\/p>\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-4fc2db42-1886-4f5e-8396-2f44fad4d952\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/poblacion_mexico.csv\">poblacion_mexico<\/a><a class=\"wp-block-file__button wp-element-button\" href=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/poblacion_mexico.csv\" download=\"\" aria-describedby=\"wp-block-file--media-4fc2db42-1886-4f5e-8396-2f44fad4d952\">Descarga<\/a><\/div>\n<p><!-- \/wp:embed --><\/p>\n<p><!-- wp:code --><\/p>\n<pre class=\"wp-block-code\"><code>\n\n#### HACER LEYENDA EN LOS GRAFICOS\n\n\n\n# pARA PONER UNA LEYENDA USAREMOS LA FUNCION legend\n# SU SINTAXIS ES ? \n\n?legend\n\n#en general seria algo as\u00ed\n\nlegend(x, y,   # Coordenadas (x tambi\u00e9n acepta palabras clave)\n       legend, # Vector con el nombre de cada grupo\n       fill,   # Crea rect\u00e1ngulos en la leyenda con los colores especificados\n       col = par(\"col\"), # Color de las l\u00edneas o s\u00edmbolos\n       border = \"black\", # Color del borde de los rect\u00e1ngulos\n       lty, lwd,         # Tipo y ancho de l\u00ednea\n       pch,              # A\u00f1ade s\u00edmbolos pch a las l\u00edneas o rect\u00e1ngulos\n       bty = \"o\",        # Tipo de caja de la leyenda (bty = \"n\" elimina el borde)\n       bg = par(\"bg\")    # Color de fondo de la leyenda\n       box.lwd = par(\"lwd\"), # Ancho de l\u00ednea de la leyenda\n       box.lty = par(\"lty\"), # Tipo de l\u00ednea de la leyenda\n       box.col = par(\"fg\"),  # Color de l\u00ednea de la leyenda\n       cex = 1,          # Tama\u00f1o de la leyenda\n       horiz = FALSE     # Leyenda horizontal (TRUE) o vertical (FALSE)\n       title = NULL      # T\u00edtulo de la leyenda\n)\n\n\n\n# Funcion plot\n\nplot(pib_espa\u00f1a_per,type=\"l\")\n\nplot(pib_argentina_per,type=\"l\",col=\"blue\", main=  \"PIB per capita ARGENTINA y MEXICO\",\n     lwd = 2,lty = 2)\nlines(pib_mexico_per,col=\"green\",lwd = 2,lty = 1)\n\n#\u263cPor una parte, puedes establecer el argumento x como \"top\", \n#\"topleft\", \"topright\", \"bottom\", \"bottomleft\", \"bottomright\", \n#\"left\", \"right\" o \"center\"\n\nlegend(x = \"topleft\",         # Posici\u00f3n\n       legend = c(\"ARGENTINA\", \"MEXICO\"), # Textos de la leyenda\n       #inset= 0.10,\n       lty = c(2, 1),          # Tipo de l\u00edneas\n       col = c(\"blue\", \"green\"),          # Colores de las l\u00edneas\n       lwd = 2)   \n\nplot(pib_argentina_per,type=\"l\",col=\"blue\", main=  \"PIB per capita ARGENTINA y MEXICO\",\n     lwd = 2,lty = 2)\nlines(pib_mexico_per,col=\"green\",lwd = 2,lty = 1)\n\nlegend(x = \"topleft\",         # Posici\u00f3n\n       legend = c(\"ARGENTINA\", \"MEXICO\"), # Textos de la leyenda\n       inset = 0.08,\n       bg = rgb(1, 0, 0, alpha = 0.10), # Color de fondo\n       box.col = \"black\",               # Color del borde\n       lty = c(2, 1),          # Tipo de l\u00edneas\n       col = c(\"blue\", \"green\"),          # Colores de las l\u00edneas\n       lwd = 2)   \n\n\n#Tambien podriamos poner titulo a la leyenda\n\nplot(pib_argentina_per,type=\"l\",col=\"blue\", main=  \"PIB per capita ARGENTINA y MEXICO\",\n     lwd = 2,lty = 2)\nlines(pib_mexico_per,col=\"green\",lwd = 2,lty = 1)\n\nlegend(x = \"topleft\",         # Posici\u00f3n\n       legend = c(\"ARGENTINA\", \"MEXICO\"), # Textos de la leyenda\n       title = \"PIB per c\u00e1pita\", # T\u00edtulo\n       title.adj = 0.1,          # Ajuste horizontal del t\u00edtulo\n       title.col = \"blue\",       # Color del t\u00edtulo\n       inset = 0.08,\n       bg = rgb(1, 0, 0, alpha = 0.20), # Color de fondo\n       box.col = \"black\",               # Color del borde\n       lty = c(2, 1),          # Tipo de l\u00edneas\n       col = c(\"blue\", \"green\"),          # Colores de las l\u00edneas\n       lwd = 2)   \n\n#\u00b6tambien cambiar los bordes\n\nplot(pib_argentina_per,type=\"l\",col=\"blue\", main=  \"PIB per capita ARGENTINA y MEXICO\",\n     lwd = 2,lty = 2)\nlines(pib_mexico_per,col=\"green\",lwd = 2,lty = 1)\n\nlegend(x = \"topleft\",         # Posici\u00f3n\n       legend = c(\"ARGENTINA\", \"MEXICO\"), # Textos de la leyenda\n       title = \"PIB per c\u00e1pita\", # T\u00edtulo\n       title.adj = 0.5,          # Ajuste horizontal del t\u00edtulo\n       title.col = \"blue\",       # Color del t\u00edtulo\n       \n       box.lty = 2, # Tipo de l\u00ednea de la caja\n       box.lwd = 3, # Ancho de l\u00ednea de la caja\n      \n       \n       inset = 0.08,\n       bg = rgb(1, 0, 0, alpha = 0.20), # Color de fondo\n       box.col = \"black\",               # Color del borde\n       lty = c(2, 1),          # Tipo de l\u00edneas\n       col = c(\"blue\", \"green\"),          # Colores de las l\u00edneas\n       lwd = 2)   \n\n\n#\u2665 tama\u00f1o de leyenda  con cex =\n\nplot(pib_argentina_per,type=\"l\",col=\"blue\", main=  \"PIB per capita ARGENTINA y MEXICO\",\n     lwd = 2,lty = 2)\nlines(pib_mexico_per,col=\"green\",lwd = 2,lty = 1)\n\n\nlegend(x = \"topleft\",         # Posici\u00f3n\n       legend = c(\"ARGENTINA\", \"MEXICO\"), # Textos de la leyenda\n       inset = 0.08,\n       cex = 1, # Cambiar el tama\u00f1o\n       lty = c(2, 1),          # Tipo de l\u00edneas\n       col = c(\"blue\", \"green\"),          # Colores de las l\u00edneas\n       lwd = 2)   \n\n###### <\/code><\/pre>\n<p><!-- \/wp:code --><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>En este tutorial aprenderemos a a\u00f1adir leyendas y personalizarlas en gr\u00e1ficos de R. En este caso usaremos la funci\u00f3n \u00ablegend\u00bb para hacer algunos ejemplos. Abajo tienes el c\u00f3digo en R del video( Descarga los datos que usan en el tutorial aqu\u00ed) https:\/\/youtu.be\/HiuZNdkMYPA DATOS Y C\u00d3DIGO EN R \u00a0<\/p>\n","protected":false},"author":19,"featured_media":3515,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[13],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13 - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13 - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\" \/>\n<meta property=\"og:description\" content=\"En este tutorial aprenderemos a a\u00f1adir leyendas y personalizarlas en gr\u00e1ficos de R. En este caso usaremos la funci\u00f3n \u00ablegend\u00bb para hacer algunos ejemplos. Abajo tienes el c\u00f3digo en R del video( Descarga los datos que usan en el tutorial aqu\u00ed) https:\/\/youtu.be\/HiuZNdkMYPA DATOS Y C\u00d3DIGO EN R \u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/\" \/>\n<meta property=\"og:site_name\" content=\"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-08T09:56:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-08T15:15:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/victor-a.rico-28.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Victor A.Rico\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Victor A.Rico\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/\"},\"author\":{\"name\":\"Victor A.Rico\",\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/person\/e563011388ed0c4e7c1cdae9fcf95bae\"},\"headline\":\"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13\",\"datePublished\":\"2023-03-08T09:56:51+00:00\",\"dateModified\":\"2023-03-08T15:15:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/\"},\"wordCount\":92,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ricovictor.com\/#organization\"},\"articleSection\":[\"R studio\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/\",\"url\":\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/\",\"name\":\"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13 - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\",\"isPartOf\":{\"@id\":\"https:\/\/ricovictor.com\/#website\"},\"datePublished\":\"2023-03-08T09:56:51+00:00\",\"dateModified\":\"2023-03-08T15:15:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/ricovictor.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ricovictor.com\/#website\",\"url\":\"https:\/\/ricovictor.com\/\",\"name\":\"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/ricovictor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ricovictor.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ricovictor.com\/#organization\",\"name\":\"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\",\"url\":\"https:\/\/ricovictor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2026\/02\/cropped-ChatGPT-Image-4-feb-2026-12_41_28.png\",\"contentUrl\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2026\/02\/cropped-ChatGPT-Image-4-feb-2026-12_41_28.png\",\"width\":1402,\"height\":474,\"caption\":\"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\"},\"image\":{\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/person\/e563011388ed0c4e7c1cdae9fcf95bae\",\"name\":\"Victor A.Rico\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4edf55780c0c232271ecbcb12fae9460?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4edf55780c0c232271ecbcb12fae9460?s=96&d=mm&r=g\",\"caption\":\"Victor A.Rico\"},\"url\":\"https:\/\/ricovictor.com\/index.php\/author\/granada_26_wp\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13 - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/","og_locale":"es_ES","og_type":"article","og_title":"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13 - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","og_description":"En este tutorial aprenderemos a a\u00f1adir leyendas y personalizarlas en gr\u00e1ficos de R. En este caso usaremos la funci\u00f3n \u00ablegend\u00bb para hacer algunos ejemplos. Abajo tienes el c\u00f3digo en R del video( Descarga los datos que usan en el tutorial aqu\u00ed) https:\/\/youtu.be\/HiuZNdkMYPA DATOS Y C\u00d3DIGO EN R \u00a0","og_url":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/","og_site_name":"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","article_published_time":"2023-03-08T09:56:51+00:00","article_modified_time":"2023-03-08T15:15:09+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/ricovictor.com\/wp-content\/uploads\/2023\/03\/victor-a.rico-28.jpg","type":"image\/jpeg"}],"author":"Victor A.Rico","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Victor A.Rico","Tiempo de lectura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/#article","isPartOf":{"@id":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/"},"author":{"name":"Victor A.Rico","@id":"https:\/\/ricovictor.com\/#\/schema\/person\/e563011388ed0c4e7c1cdae9fcf95bae"},"headline":"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13","datePublished":"2023-03-08T09:56:51+00:00","dateModified":"2023-03-08T15:15:09+00:00","mainEntityOfPage":{"@id":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/"},"wordCount":92,"commentCount":0,"publisher":{"@id":"https:\/\/ricovictor.com\/#organization"},"articleSection":["R studio"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/","url":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/","name":"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13 - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","isPartOf":{"@id":"https:\/\/ricovictor.com\/#website"},"datePublished":"2023-03-08T09:56:51+00:00","dateModified":"2023-03-08T15:15:09+00:00","breadcrumb":{"@id":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ricovictor.com\/index.php\/2023\/03\/08\/anadir-leyenda-en-graficos-de-r-aprende-en-r-desde-0-clase-13\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/ricovictor.com\/"},{"@type":"ListItem","position":2,"name":"A\u00f1adir Leyenda en Gr\u00e1ficos de R | Aprende en R desde 0 \/ Clase 13"}]},{"@type":"WebSite","@id":"https:\/\/ricovictor.com\/#website","url":"https:\/\/ricovictor.com\/","name":"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","description":"","publisher":{"@id":"https:\/\/ricovictor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ricovictor.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/ricovictor.com\/#organization","name":"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","url":"https:\/\/ricovictor.com\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/ricovictor.com\/#\/schema\/logo\/image\/","url":"https:\/\/ricovictor.com\/wp-content\/uploads\/2026\/02\/cropped-ChatGPT-Image-4-feb-2026-12_41_28.png","contentUrl":"https:\/\/ricovictor.com\/wp-content\/uploads\/2026\/02\/cropped-ChatGPT-Image-4-feb-2026-12_41_28.png","width":1402,"height":474,"caption":"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas"},"image":{"@id":"https:\/\/ricovictor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/ricovictor.com\/#\/schema\/person\/e563011388ed0c4e7c1cdae9fcf95bae","name":"Victor A.Rico","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/ricovictor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4edf55780c0c232271ecbcb12fae9460?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4edf55780c0c232271ecbcb12fae9460?s=96&d=mm&r=g","caption":"Victor A.Rico"},"url":"https:\/\/ricovictor.com\/index.php\/author\/granada_26_wp\/"}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/posts\/3513"}],"collection":[{"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/comments?post=3513"}],"version-history":[{"count":9,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/posts\/3513\/revisions"}],"predecessor-version":[{"id":3545,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/posts\/3513\/revisions\/3545"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/media\/3515"}],"wp:attachment":[{"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/media?parent=3513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/categories?post=3513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/tags?post=3513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}