Skip to content

Data Science Tutorials

For Data Science Learners

  • Triangular Distribution in R
    Triangular Distribution in R R
  • Group By Minimum in R
    Group By Minimum in R R
  • Convert characters to time in R R
  • What is bias variance tradeoff
    What is the bias variance tradeoff? R
  • Data Science Applications in Banking
    Data Science Applications in Banking Machine Learning
  • How to Replace Inf Values with NA in R
    How to Replace Inf Values with NA in R R
  • Quantiles by Group calculation in R
    Quantiles by Group calculation in R with examples R
  • How to Use Gather Function in R
    How to Use Gather Function in R?-tidyr Part2 R
ggdogs on ggplot2

ggdogs on ggplot2

Posted on October 21October 21 By Admin 1 Comment on ggdogs on ggplot2

ggdogs on ggplot2, With the help of the function instead of, you may use the package to add dog-related photos in place of dots in ggplot2.

ggdogsgeom_doggeom_point 

You can send any of the sentences listed above to the feature to use the associated dog images. There are currently 15 different breeds of dogs accessible, called (by default),.

How to Add a caption to ggplot2 Plots in R? (datasciencetut.com)

"doge""doge_strong""chihuahua""eyes""gabe""glasses""tail""surprised""thisisfine""hearing""pug""ears""husky""husky_2""chilaquil"

All of the dogs are shown in the following figure:

install.packages("remotes")
remotes::install_github("R-CoderDotCom/ggdogs@main")
library(ggdogs)
install.packages("ggplot2")
library(ggplot2)
grid <- expand.grid(1:5, 3:1)
df <- data.frame(x = grid[, 1],
y = grid[, 2],
image = c("doge", "doge_strong", "chihuahua",
"eyes", "gabe", "glasses",
"tail", "surprised", "thisisfine",
"hearing", "pug", "ears",
"husky", "husky_2", "chilaquil"))
ggplot(df) +
geom_dog(aes(x, y, dog = image), size = 5) +
geom_text(aes(x, y - 0.5, label = image), size = 2.5) +
xlim(c(0.25, 5.5)) +
ylim(c(0.25, 3.5))

Making dog-themed graphics using geom_dog

The function can be used in the same way as when given a data frame. The primary distinction is that default points have been replaced with Doge dogs.

Note that the function’s argument allows you to change the size of photos.

5 Free Books to Learn Statistics For Data Science – Data Science Tutorials

geom_doggeom_pointsize

Additionally, you can combine typical charts with. In the example below, we’re making a scatter plot with a picture of a dog and some text.

set.seed(123)
df <- data.frame(x = 1:10, y = rnorm(10))
ggplot(df, aes(x = x, y = y)) +
geom_point(size = 3, color = 4) +
geom_dog(aes(x = 7, y = -0.5), dog = "thisisfine", size = 5) +
geom_label(aes(x = 7.75, y = -0.1, label = "datasciencetut.com"))

Be aware that you can send that column as an argument so that each point has the appropriate dog if your data frame contains a column with the dog name matching each data point.

set.seed(123)
df <- data.frame(x = 1:10, y = rnorm(10),
dog = c(rep("husky", 5),
rep("gabe", 5)))
ggplot(df, aes(x = x, y = y, dog = dog)) +
geom_dog(size = 5)

The final illustration displays a number of Doge canines.

How to make a rounded corner bar plot in R? – Data Science Tutorials

set.seed(123)
df <- data.frame(x = 1:10, y = rnorm(10),
dog = c(rep("husky", 5),
rep("gabe", 5)))
ggplot(df, aes(x = x, y = y)) +
geom_dog(size = 2.5) +
geom_dog(aes(x = 5, y = 0.25, dog = "doge_strong"), size = 12)

Check your inbox or spam folder to confirm your subscription.

R

Post navigation

Previous Post: How to create Radar Plot in R-ggradar
Next Post: How to create Anatogram plot in R

Related Posts

  • gganatogram Plot in R
    How to create Anatogram plot in R R
  • Return the corresponding value of Cauchy density in R
    Return the corresponding value of Cauchy density in R R
  • Changing the Font Size in Base R Plots
    Changing the Font Size in Base R Plots R
  • Sort Data in R With Examples
    Sort Data in R With Examples R
  • Wrap a character string in R R
  • How to perform TBATS Model in R
    How to perform TBATS Model in R R

Comment (1) on “ggdogs on ggplot2”

  1. Asei ITO says:
    October 26 at 8:34 pm

    This is great.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Best Prompt Engineering Books
  • Understanding Machine Learning and Data Science
  • Best Git Books
  • Top 5 Books to Learn Data Engineering
  • Mastering R Programming for Data Science: Tips and Tricks
  • About Us
  • Contact
  • Disclaimer
  • Privacy Policy

https://www.r-bloggers.com

  • YouTube
  • Twitter
  • Facebook
  • Course
  • Excel
  • Machine Learning
  • Opensesame
  • R
  • Statistics

Check your inbox or spam folder to confirm your subscription.

  • Best Books to Learn R Programming
    Best Books to Learn R Programming Course
  • Correlation By Group in R R
  • How to Compare Two Lists in Excel Using VLOOKUP
    How to Compare Two Lists in Excel Using VLOOKUP Excel
  • Dynamic data visualizations in R
    Dynamic data visualizations in R R
  • How to Calculate Relative Frequencies in R
    How to Calculate Relative Frequencies in R? R
  • Data Science Strategies for Improving Customer Experience in R
    Data Science Strategies for Improving Customer Experience in R R
  • One proportion Z Test in R
    One proportion Z Test in R R
  • one-sample-proportion-test-in-r
    One sample proportion test in R-Complete Guide R

Privacy Policy

Copyright © 2025 Data Science Tutorials.

Powered by PressBook News WordPress theme