Skip to content

Data Science Tutorials

For Data Science Learners

  • Top 7 Skills Required to Become a Data Scientist
    Top 7 Skills Required to Become a Data Scientist Machine Learning
  • Display the structure in R R
  • Best Books on Generative AI Course
  • sorting in r
    Sorting in r: sort, order & rank R Functions R
  • How to Prepare a Machine Learning Interview
    How to Prepare a Machine Learning Interview? Machine Learning
  • Error in sum(List) : invalid 'type' (list) of argument
    Error in sum(List) : invalid ‘type’ (list) of argument R
  • Ad Hoc Analysis
    What is Ad Hoc Analysis? Statistics
  • How Do Machine Learning Chatbots Work
    How Do Machine Learning Chatbots Work Machine Learning
gganatogram Plot in R

How to create Anatogram plot in R

Posted on October 21October 21 By Admin 3 Comments on How to create Anatogram plot in R

How to create Anatogram plot in R, Anatograms can be produced using the same-named package function.

Keep in mind that you can design your own data frame.

Man

Pass the data frame to the function with the parameters and construct the anatogram of a guy.

Please take note that we utilized to keep dimensions and set a blank theme.

install.packages("remotes")
remotes::install_github("jespermaag/gganatogram")
library(gganatogram)
gganatogram(data = hgMale_key,
organism = "human", sex = "male",
fill = "colour", fillOutline = "#a6bddb") +
theme_void() +
coord_fixed()

How to create a ggalluvial plot in R? – Data Science Tutorials

Woman

Anatogram creation for a woman follows a similar procedure to that for a male, except passing the data frame and specifying

library(gganatogram)
gganatogram(data = hgFemale_key,
organism = "human", sex = "female",
fill = "colour", fillOutline = "#a6bddb") +
theme_void() +
coord_fixed()

Zoom

You can utilize it if you need to zoom in on a particular area of the anatogram.

If you want to see the values of the axes, don’t forget to erase the subject.

library(gganatogram)
gganatogram(data = hgMale_key,
organism = "human", sex = "male",
fill = "colour", fillOutline = "#a6bddb") +
coord_cartesian(xlim = c(30, 75), ylim = c(-40, 0)) +
theme_void()

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

Systems

You can only choose a small number of body systems; the default graph displays all of them.

You can choose to merely sketch the systems if you like. To view the available options or type.

library(dplyr)
hgMale_key %>%
filter(type %in% "nervous_system") %>%
gganatogram(organism = "human", sex = "male",
fill = "colour", outline = FALSE) +
theme_void() +
coord_fixed()

Organs

You can sketch some organs in a manner similar to how you draw some systems.

library(dplyr)
hgMale_key %>%
filter(organ %in% c("brain", "heart")) %>%
gganatogram(organism = "human", sex = "male",
fill = "colour") +
theme_void() +
coord_fixed()

colour scale

Based on the column of the data frames, the colour scale can be modified by adding a continuous colour scale, like viridis.

library(dplyr)
hgMale_key %>%
filter(organ %in% c("brain", "heart")) %>%
gganatogram(organism = "human", sex = "male",
fill = "colour") +
theme_void() +
coord_fixed()

Check your inbox or spam folder to confirm your subscription.

R

Post navigation

Previous Post: ggdogs on ggplot2
Next Post: Box Cox transformation in R

Related Posts

  • How to do Conditional Mutate in R
    How to do Conditional Mutate in R? R
  • Triangular Distribution in R
    Triangular Distribution in R R
  • How to use image function in R
    How to use the image function in R R
  • Add new calculated variables to a data frame and drop all existing variables
    Add new calculated variables to a data frame and drop all existing variables R
  • Divide data into groups in R R
  • Multiple regression model in R R

Comments (3) on “How to create Anatogram plot in R”

  1. Manuel says:
    October 26 at 12:11 am

    > library(dplyr)
    > library(gganatogram)
    > gganatogram(data = hgFemale_key,
    + organism = “human”, sex = “female”,
    + fill = “colour”, fillOutline = “#a6bddb”) +
    + theme_void() +
    + coord_fixed()
    Error in alpha(first_rows$fill, first_rows$alpha) :
    unused argument (first_rows$alpha)

    Reply
    1. Jim says:
      October 26 at 3:19 pm

      theme_void() +
      + coord_fixed()

      Two times + argument

      Reply
  2. Elise says:
    October 30 at 2:32 am

    I’m not a massive user of r, so apologies for what might be a silly question:

    The code under “colour scale” is identical to the code used in “organs”. I cannot tell if this is deliberate because the text described modifying the data frames or a simple copy-paste error.

    Everything above has worked perfectly though, so enormous thanks

    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.

  • How to create contingency tables in R
    How to create contingency tables in R? R
  • AI in Delivery Management
    AI in Delivery Management Machine Learning
  • Change ggplot2 Theme Color in R
    Change ggplot2 Theme Color in R ggthemr Package R
  • Separate a data frame column into multiple columns
    Separate a data frame column into multiple columns-tidyr Part3 R
  • Determine the significance of a mediation effect in R
    Determine the significance of a mediation effect in R R
  • Tips for Data Scientist Interview Openings
    Tips for Data Scientist Interview Openings Course
  • Adding Subtitles in ggplot2 R
  • How do augmented analytics work
    How do augmented analytics work? R

Privacy Policy

Copyright © 2025 Data Science Tutorials.

Powered by PressBook News WordPress theme