Questions tagged [ggimage]

An R package aims to support image files and graphic objects visualization based on 'ggplot2' graphic system.

Resources:

  1. cran.r-project.org
  2. github
34 questions
2
votes
2 answers

How to remove background of images with the magick package?

Is it possible to remove the background of images with the magick package? I know how to use edge detection with Gimp/Inkscape to crop out silhouettes; however, I'm looking to automate the process for a large batch of images with R. My ultimate goal…
1
vote
2 answers

Bubble chart with round country flag symbols in ggplot/ggimage

I try to make a bubble chart with ggplot/ggimage by including the country flag. Here is a reproducible example: library(dplyr) library(ggplot) library(ggimage) A <- data.frame(X = c(1,4,5), Y = c(10, 1, 5), Z = c(1, 2, 3)/30, Country = c("FR",…
Quynh-Mai Chu
  • 165
  • 1
  • 9
1
vote
1 answer

Avoid overlap of points on a timeline (1-D repeling)

I want to create a timeline plot that roughly resembles the example below: lots of overlap at some points, not a lot of overlap at others. What I need: overlapping images should repel each other where necessary, eliminating or reducing overlap.…
Kene David Nwosu
  • 828
  • 6
  • 12
1
vote
2 answers

Maintaining Aspect Ratio of Shapes and Images in ggplot/ ggimage

I'm trying to build a visualisation with both drawn shapes (e.g. using geom_circle) and images. In both cases, I want to be able to position them on the page specifically with coordinates, rather than using one of the built in chart types. See…
Chris
  • 1,449
  • 1
  • 18
  • 39
1
vote
1 answer

Is it possible to add custom shapes ( from png) to ggplot legend?

I was wondering whether it is possible to add shapes to the legend for ggimage(). I found similar questions, but they either have 1) same picture with a different color in legend, or 2) same picture different colors. I used this link to add images…
yuliaUU
  • 1,581
  • 2
  • 12
  • 33
1
vote
1 answer

R Image scaling for heatmap

I am currently working on a problem with R. I'm pretty new to R so I lack of experience, on a (I guess) simple issue. I have a problem with scaling an image in relation to some data I have. The Image is a floor plan. The data I have is recorded…
1
vote
2 answers

Loading a raster data of map PNG on ggmaps of R

This will be cross posted on R's mailing list. I have the map as a png, so I won't be using the get_map function. I have extracted the raster data from the png, and I wish to load the map as it is on the display of R, and then I would like to plot…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
0
votes
1 answer

Getting a "UnableToOpenBlob" error when attempting to create a graph with custom point images using geom_image in ggplot2

i'm trying to build a dotplot with an image diplayed at every data point instead of just a bland point. I have tried many methods of introducing the data to R, and this is the closest ive gotten. In my data sheet I have a column with either NY_Male,…
L Trimm5
  • 1
  • 1
0
votes
1 answer

Using ggimage to add images to labels in R

Is there a way to use geom_image to replace text labels to images in a pie chart? I tried using the code below. However, the images aren't in the same position as the labels. (I included the labels to show where the images should go but I want to…
0
votes
1 answer

How to use svg with geom_image in R?

I like to use some icons and images in my ggplot, thus use the ggimage package. I can make it work with local or online images in .png format. But it does not work with svg such as…
Marco
  • 2,368
  • 6
  • 22
  • 48
0
votes
1 answer

Use geom_label_repel only for certain observations?

I'm a football data analyst using NFL team logos as my points on a scatterplot. However, these images will sometimes cover each other up. I want to find a way to repel a label for those images that are overlapping with one another. However, I…
0
votes
1 answer

ggplot, scatterplot over an image

I'm looking for a way to plot over an image with predefined fields and get a result like this: I want to build it from: (1): a PNG image with the fields with predefined x and y limits like this: and (2): a scatterplot, e.g.: mpg %>% ggplot() + …
0
votes
1 answer

Cannot plot correctly with geom_flags

I am trying to plot some data (mainly character data, unfortunately) and I wanted to use geom_flag to create little flag images to put under the labels on the x axis (x = Country) to make it more clear since I cannot write the full country name (it…
0
votes
1 answer

Specifiying size of geom_image causing it to become way too big every time?

This was not happening before, and then at some point my size function just kind of broke to the point where any attempt to specify size causes the images to inflate to a ridiculous size. Here is the code where I set the size to .1: G <- ggplot(G1,…
0
votes
1 answer

geom_image from ggimage arbitrarily selects aspect ratio

I am trying to insert a logo in my plot using geom_image(). The original logo is available here: https://www.itvoice.in/wp-content/uploads/2016/12/zebronics_footer_logo.png and looks like this: When I make a ggplot using the code below, I get this…