1
$\begingroup$

Having this R statement:

itemsets = apriori(data, parameter=list(support=0.05, confidence=0.5))
plot(itemsets, method="graph", 
     control=list(type="items"))

How can I change the colour of my plot? I try to insert "col" but don't allows me to do that because I'm getting the following error:

Error in i.parse.plot.params(graph, list(...)) : 
  Unknown plot parameters: col

thanks

$\endgroup$
2
  • $\begingroup$ Hey, welcome to DataScience-SE. Please, mention the error message you're getting. It will help in sorting it out. Cheers! $\endgroup$ Nov 6 '16 at 8:04
  • $\begingroup$ @AbhishekJaiswal thanks for your comment. I updated the post wit the error :) Yes, I try with "col = "red" " statement $\endgroup$ Nov 6 '16 at 9:29
1
$\begingroup$

Use edgeCol and nodeCol:

library("arulesViz")
data(Groceries)
rules <- apriori(Groceries, parameter=list(support=0.005, confidence=0.5))
plot(rules, method="graph",
     control=list(nodeCol="yellow", edgeCol="blue", type="items"))

plot

$\endgroup$
0
$\begingroup$

Okay, try this--

itemsets = apriori(data, parameter=list(support=0.05, confidence=0.5))
plot(itemsets, method="graph", 
     control=list(type="items", col="red"))

Cheers!

$\endgroup$
1
  • $\begingroup$ thanks for your answer. The code runs well but my chart still have the same colour even if I change to green or blue. Do you know why? I'm using RStudio $\endgroup$ Nov 6 '16 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.