0

Please refer to this question to have an example to work with: Is there any way to manipulate the titles of a ctree plot?

Now, with the example ctree plot as a reference, how can I make it so that the two words that make up the title are on two different lines? I.e. I want to see the word "Broken" and then the word "Title" on a new line below the word "Broken."

I'm trying to make the boxplots skinnier. So far, the only way I've found to do this is to use:

png(title_file, width = w, height = h)

And then vary w and h until I'm happy. Unfortunately, this cuts off the title (The actual title is much longer) I think that if I could make half the title appear on the next line then everything should fit snugly (fingers-crossed).

If you however have a way for me to directly manipulate the boxplots (node 2 and node 3) and adjust their fatness without me having to adjust the width of the entire image, that would be even better.

Community
  • 1
  • 1
Frikster
  • 2,755
  • 5
  • 37
  • 71
  • 1
    Just running `plot(urp, main = "Broken\nTitle")` should make the plot title appear on two lines unless i'm missing something. – MrFlick Oct 17 '14 at 05:50
  • Yes that works. In fact I've done that before and am embarrassed that I forgot about it. Since I need to output to file I simply do: png(title_file) plot(urp, main = "Broken\nTitle") dev.off() – Frikster Oct 20 '14 at 22:35

1 Answers1

0

Notice that this is in the Details section of ?plot.BinaryTree:

... additional arguments passed to callies.

I understood that to mean "callees", namely functins called by that plot method. The second component of the question is probably answered by following the link to node_boxplot from the ?plot.BinaryTree help page:

node_barplot(ctreeobj, col = "black", fill = NULL, beside = NULL,
  ymax = NULL, ylines = NULL, widths = 1, gap = NULL, 
  reverse = NULL, id = TRUE)
IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • Thank you, that definitely got me on the right track, but none of the functions in the documentation seem to alter the terminal boxplot width. Note that I have boxplots, so node_barplot is probably not what I need. I looked at node_boxplot(ctreeobj, col = "black", fill = "lightgray", width = 0.5, yscale = NULL, ylines = 3, cex = 0.5, id = TRUE) and changing width here changes the boxplot's width without changing the width of the borders of the node it is in. I need the terminal nodes itself to have decreased width (not just the boxplots inside) and there seems to be no way of doing this. – Frikster Oct 20 '14 at 23:39
  • I also looked at node_terminal(ctreeobj, digits = 3, abbreviate = FALSE, fill = c("lightgray", "white"), id = TRUE) Sadly, it does not take any parameter that seems to allow me to control terminal node width :( – Frikster Oct 20 '14 at 23:40