0

enter image description hereIn my software i am drawing 8 different graph drawings using igraph, when they pop up they are simply numbered graph1, graph2 and so on. I need to rename the windows with a predefined message.

I couldn't find the right instruction to do it.

I need to change the "graph plot 1" into my message

Alex Fort
  • 93
  • 6

1 Answers1

0

Ok, so in the tkplot source code, you can see where it assigns the name to the window at line 114:

tcltk::tktitle(top) <- paste("Graph plot", as.character(tkp.id))

You could modify this to say:

tcltk::tktitle(top) <- paste(windowname, as.character(tkp.id))

And define it as a new function with windowname as an option which accepts a string. You have to assign it to the igraph namespace so it can call up all subroutines, but should work. Kind of wonky, maybe there's an easier way.

paqmo
  • 3,649
  • 1
  • 11
  • 21
  • No, i will try to post a drawing in order to be more clear, i am not using plot function, I am using tkplot function. – Alex Fort Oct 25 '16 at 15:27
  • I see, there is any other chance? thsi is quite amazing that a so simple function must imply such deep intervention in the source code ! – Alex Fort Oct 27 '16 at 09:56
  • 1
    @AlexFort I think it is usual enough that the igraph folks didn't consider it as an option. There are simpler ways to control the names of the X11 and Quartz windows using device commands (e.g., check out `?X11`), but `tkplot` launches its own window--doesn't use an initialized window. So I think editing the source code is easiest. – paqmo Oct 27 '16 at 14:40
  • Once you define it as a new function and assign it to the igraph namespace it will be locally available throughout your session. – paqmo Oct 27 '16 at 14:41