ggPMX icon indicating copy to clipboard operation
ggPMX copied to clipboard

Freeing scales on a facetted plot does not work

Open biencan1 opened this issue 3 years ago • 3 comments
trafficstars

Facet argument should be taking over parameters from facet_wrap but freeing scales does not work. Example below:

ctr %>% pmx_plot_dv_pred(bloq=pmx_bloq(cens="BLOQ",colour="blue",size=1),
                         use.abbrev = TRUE,
		         is.draft=FALSE,
                         strat.facet = ~TRT,
		         facets=list(scales="free",nrow=1),       #scales doesn't work with this faceting 
                         labels=list(title="DV vs PRED by dose"))

Produces: image

Generated with ggPMX 1.2.8

biencan1 avatar Aug 26 '22 08:08 biencan1

  • issue has been reproduced

  • it has been possible to identify what the source of the error is

  • it does not relate to the arguments to facet_wrap not being passed through, but rather that they do not take effect

  • the reason they do not take effect is that coord_cartesian is used prior to the scales="free" argument of facet_wrap being applied

    • this takes place in the plot_pmx.residual function
  • a fix is in progress

tynsci avatar Oct 18 '22 05:10 tynsci

  • works now subject to pull request #278 plot_works

tynsci avatar Oct 26 '22 16:10 tynsci

This was accidently closed by me because I accidently merged the Pull request #278. As I mentioned to @tynesjo we cannot use internal ggplot2 functions even if they fix the problem. This would not be accepted by CRAN. It violates their policies.

mattfidler avatar Nov 09 '22 18:11 mattfidler