Reputation: 600
I'm trying to remove the labels of the Node id's at the terminal panel of a partykit object (those that say Node x...), following the instructions with terminal_panel
, I can change the inner_panel
without trouble, but the plot includes information of the object instead of the bars:
library(partykit)
ea = ctree(Species ~ ., data = iris)
plot(ea, gp = gpar(fontsize = 8),
inner_panel = node_inner,
ip_args=list(
abbreviate = F,
id = FALSE),
terminal_panel = node_terminal,
tp_args = list(digits = 2, abbreviate = T, id = F))
Which plots the following,
Upvotes: 2
Views: 328
Reputation: 118
I think you can remove some arguments to get your desired output. This code removes the "Node x" label and plots the bars for each terminal node
plot(ea,
gp = gpar(fontsize = 8),
inner_panel = node_inner,
ip_args = list(
abbreviate = F,
id = FALSE
),
tp_args = list(id = FALSE)
)
Does that solve your problem?
Upvotes: 3