library(plotly)
## Warning: package 'plotly' was built under R version 4.2.2
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
f <- list(
  family = "Times New Roman",
  size = 15,   color = "#FFFFFF" )
x <- list(
  title = "Weight",   titlefont = f )

y <- list(
  title = "MPG",   titlefont = f )
plot_ly(mtcars, x = mtcars$wt, y=mtcars$mpg, mode="markers", 
        type="scatter",color=as.factor(mtcars$cyl), size=mtcars$hp ) %>%   
        layout(xaxis=x, yaxis=y)
## Warning: `line.width` does not currently support multiple values.

## Warning: `line.width` does not currently support multiple values.

## Warning: `line.width` does not currently support multiple values.