Batman plots have been produced many times. An earlier version is given at https://guangchuangyu.github.io/2011/08/the-batman-equation/. The author already used ggplot2 for drawing the plot. The input for the ggplot2-routines consisted of dataframes that were prepared based on the parts of the Batman equation.

More recently an approach that directly used the constituting parts of the Batman equation as arguments for the plotting routines is given on CoCalc.

If you are interested in how the same approach as on CoCalc can be used with R and ggplot2, please keep on reading here.