I am currently trying to plot some association rules with confidence as the y-axis and support as the x-axis. However, I want to limit the y-axis range to be 0 to 1, and the x-axis range to be 0 to 0.3. I've tried using xlim and ylim, however, when I write this:
plot(myRules, measure = c("support", "confidence"), shading = "lift", xlim =c(0,0.3), ylim =c(0,1))
I get the following error:
Warning: Unknown control parameters: xlim, ylim
I've looked this up and can't find any example where limiting axes range for association rules visualization or this error is addressed. How do I fix this?
We don't have your
myRulesobject, but we can create something similar for demonstration purposes:The standard plot looks like this:
Note that in
arulesViz, the genericplotfunction actually creates aggplotobject, so we are free to set our own scales and co-ordinates. To limit the x axis to be between 0 and 0.3, we can do:You can also add
, ylim = c(0, 0.3)right afterxlim = c(0, 0.3)if you want to limit the y axis too.Created on 2022-04-04 by the reprex package (v2.0.1)