sinhrks / ggfortify

Define fortify and autoplot functions to allow ggplot2 to handle some popular R packages.
Other
525 stars 65 forks source link

Possible issue adding labels to certain plots #211

Closed alexandra-wall closed 3 years ago

alexandra-wall commented 3 years ago

Hello,

Thanks for your package.

While using the package I noticed the functions autoplot.density, autoplot.aareg, do not seem to add axis labels to the plot when given the required arguments. I tried to re-create the plots using just ggplot2 functions and came across the same issue so it might be an issue with ggplot2, but I wasn't able to narrow it down further.

ggfortify version = 0.4.8 ggplot2 version = 3.3.0

Code to reproduce the issues ggfortify:::autoplot.density(stats::density(airquality$Wind), xlab = "X axis Label", ylab = "Y axis Label")

ggfortify:::autoplot.aareg(survival::aareg(survival::Surv(Wind) ~ Temp + Month , data = airquality), xlab = "X axis Label", ylab = "Y axis Label")

Thanks, Alexandra

Plots produced by the code above are the following, in the same order as the code: image image

terrytangyuan commented 3 years ago

Thanks for reporting! This should be fixed now. Could you try the new version from GitHub?

terrytangyuan commented 3 years ago

Fixed in https://github.com/sinhrks/ggfortify/commit/d3b5c359586b82d94245002f6841bde37ab3c0dd and https://github.com/sinhrks/ggfortify/commit/912ba6d39feb1537b30997632b1d125500c1058d.

alexandra-wall commented 3 years ago

Tested with the new version from GitHub and they are showing up now!

Thank you for such a quick response.

image

terrytangyuan commented 3 years ago

Great! Let me know if you find anything else erroneous.