Before asking, I tried to search the answer for my question, buf I couldn't find. My question is about changing edge direction in dot diagram. Rankdir is 'LR', but in certain part of graph, I want to use 'TB'. Let me give an example.
digraph G {
  rankdir=LR;
  size="7,5";
  browser->ui_thread;
  browser->db_thread;
  browser->webkit_thread;
  browser->cache_thread;
  browser->file_thread;
  browser->io_thread;
  io_thread[style=filled];
  cache_thread[style=filled];
  ui_thread->thread[label=inherit];
  ui_thread->messageloo开发者_JAVA百科p[style=dotted];
  db_thread->messageloop[style=dotted];
  webkit_thread->messageloop[style=dotted];
  cache_thread->messageloop[style=dotted];
  file_thread->messageloop[style=dotted];
  io_thread->messageloop[style=dotted];
}
it gives out graph like this

But, this is not what I want. I want the following image. "thread" is above "ui_thread" vertically.

thanks,
Unfortunately, graph direction can only be specified once, and the whole graph stays in that direction.  In this situation, you can usually get the desired effect with a combination of constraint=false and invisible edges to force some ordering.
This code will produce your second image:
digraph G {
  rankdir=LR;
  size="7,5";
  browser->thread[style=invis];
  browser->ui_thread;
  browser->db_thread;
  browser->webkit_thread;
  browser->cache_thread;
  browser->file_thread;
  browser->io_thread;  
  io_thread[style=filled];
  cache_thread[style=filled];
  ui_thread->thread[label=inherit constraint=false]; 
  ui_thread->messageloop[style=dotted];
  db_thread->messageloop[style=dotted];
  webkit_thread->messageloop[style=dotted];
  cache_thread->messageloop[style=dotted];
  file_thread->messageloop[style=dotted];
  io_thread->messageloop[style=dotted];
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论