Skip to contents

geom_cbb_teams creates a ggplot2 layer that plots college basketball team logos in place of points. The layer requires x and y aesthetics and a valid team name from the cbbdata dataset. The width parameter can be used to adjust the size of the logos. You can plot dark logos, if available, by using logo_type = 'dark'


  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  na.rm = FALSE,
  show.legend = FALSE,
  inherit.aes = TRUE,
  logo_type = "normal",
  highlight_teams = NULL,
  highlight_method = "alpha",
  highlight_alpha = 0.5



Set of aesthetic mappings created by ggplot2::aes() or ggplot2::aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.


The data to be displayed in this layer. If NULL, the default, the data is inherited from the plot data as specified in the call to ggplot().


The statistical transformation to use on the data for this layer, as a string.


Position adjustment, either as a string, or the result of a call to a position adjustment function.


Other arguments passed on to layer().


If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed.


Logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes.


If FALSE, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. borders().


Vector of team names to highlight.


Method of highlighting ("alpha", "color", or "both").


Alpha value for highlighted teams.


A ggplot2 layer that can be added to a plot created with ggplot().


This geom requires the following aesthetics:

  • x - The x-coordinate for the logo's position.

  • y - The y-coordinate for the logo's position.

  • team - The name of the team, which should be a valid team name from cbbdata.