g2r icon indicating copy to clipboard operation
g2r copied to clipboard

Is it possible to insert an image in a plot?

Open ManuelSpinola opened this issue 2 years ago • 4 comments

How can I insett an image in a plot?

ManuelSpinola avatar Jun 04 '22 19:06 ManuelSpinola

I don't think this is currently possible. I don't see that in the original docs.

JohnCoene avatar Jun 05 '22 13:06 JohnCoene

Thank you very much John,

I was thinking that the function info_image was capable of doing that.

Manuel

El dom, 5 jun 2022 a las 7:25, John Coene @.***>) escribió:

I don't think this is currently possible. I don't see that in the original docs.

— Reply to this email directly, view it on GitHub https://github.com/devOpifex/g2r/issues/8#issuecomment-1146804252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFI3FB7LRTLMOB2WTQNLS7DVNSTEZANCNFSM5X33FY7A . You are receiving this because you authored the thread.Message ID: @.***>

-- Manuel Spínola, Ph.D. Instituto Internacional en Conservación y Manejo de Vida Silvestre Universidad Nacional Apartado 1350-3000 Heredia COSTA RICA @.*** @.> @. Teléfono: (506) 8706 - 4662 Institutional website: ICOMVIS http://www.icomvis.una.ac.cr/index.php/manuel Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

ManuelSpinola avatar Jun 05 '22 21:06 ManuelSpinola

Apologies, it is indeed possible but it's very awkward.

g2(cars, asp(speed, dist)) %>%
  fig_point() %>%
  info_image(
    start = c(10, 60),
    end = c(20, 80),
    style = list(
      width = 50,
      height = 50
    ),
    src = "https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*ELYbTIVCgPoAAAAAAAAAAABkARQnAQ"
  )

JohnCoene avatar Jun 05 '22 22:06 JohnCoene

Thank you very much John.

Is it possible to include a local png file?

Manuel

El dom, 5 jun 2022 a las 16:21, John Coene @.***>) escribió:

Apologies, it is indeed possible but it's very awkward.

g2(cars, asp(speed, dist)) %>% fig_point() %>% info_image( start = c(10, 60), end = c(20, 80), style = list( width = 50, height = 50 ), src = "https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*ELYbTIVCgPoAAAAAAAAAAABkARQnAQ" )

— Reply to this email directly, view it on GitHub https://github.com/devOpifex/g2r/issues/8#issuecomment-1146893737, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFI3FBZYDXCP7MBIFOM3P43VNUSAHANCNFSM5X33FY7A . You are receiving this because you authored the thread.Message ID: @.***>

-- Manuel Spínola, Ph.D. Instituto Internacional en Conservación y Manejo de Vida Silvestre Universidad Nacional Apartado 1350-3000 Heredia COSTA RICA @.*** @.> @. Teléfono: (506) 8706 - 4662 Institutional website: ICOMVIS http://www.icomvis.una.ac.cr/index.php/manuel Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

ManuelSpinola avatar Jun 05 '22 23:06 ManuelSpinola