Decision tree - node labels font size

5,278 views
Skip to first unread message

Carlos Crosetti

unread,
Dec 23, 2016, 11:37:46 PM12/23/16
to rattle-users
Hi, I am playing with out-of-the box the Decision Tree feature and was able to plot a tree with 5 levels of depth. The nodes, branches and lines are OK, however I cannot read any of the labels nor numeric values, they are too small and zooming in does not help. Is there a way to expand the node labels text size and make the tree window scroll-able?

Graham Williams

unread,
Dec 24, 2016, 1:08:00 AM12/24/16
to rattle-users
Hi Carlos,

The short answer is no, not directly in Rattle.

However, the plot is generated underneath using rattle::fancyRpartPlot(). Have a look at the Log tab for the actual command used. This in turn uses rpart.plot::prp() and you can pass various tuning parameters to this function. Have a look at

> ?rpart.plot::prp

for details of the parameters.

So to test this you can generate the plot in Rattle and then copy the fancyRpartPlot() command from the Log tab into the R Console and then experiment:

> fancyRpartPlot(crs$rpart, main="Decision Tree")
> fancyRpartPlot(crs$rpart, main="Decision Tree", cex=1)
> fancyRpartPlot(crs$rpart, main="Decision Tree", tweak=1.5)

etc to change the font size.


Regards,
Graham

On 24 December 2016 at 03:11, Carlos Crosetti <carlos....@gmail.com> wrote:
Hi, I am playing with out-of-the box the Decision Tree feature and was able to plot a tree with 5 levels of depth. The nodes, branches and lines are OK, however I cannot read any of the labels nor numeric values, they are too small and zooming in does not help. Is there a way to expand the node labels text size and make the tree window scroll-able?

--
You received this message because you are subscribed to the Google Groups "rattle-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rattle-users+unsubscribe@googlegroups.com.
To post to this group, send email to rattle...@googlegroups.com.
Visit this group at https://groups.google.com/group/rattle-users.
For more options, visit https://groups.google.com/d/optout.

Carlos Crosetti

unread,
Jan 2, 2017, 4:04:27 AM1/2/17
to rattle-users
Thanks Greg, the code works well

Carlos Crosetti

unread,
Jan 2, 2017, 4:04:27 AM1/2/17
to rattle-users
Thanks Greg, the code you sent works well.


On Saturday, December 24, 2016 at 1:37:46 AM UTC-3, Carlos Crosetti wrote:
Reply all
Reply to author
Forward
0 new messages