Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 549459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:11:13+00:00 2026-05-13T11:11:13+00:00

I have a test graph here that I would like to tweak to make

  • 0

I have a test graph here that I would like to tweak to make it look nicer.

alt text

Here is the graphviz (dot) source, test6.dot:

digraph G {
    ranksep=0.3; size="6.0,6.0";
    node [fontsize=11];
  
    subgraph clusterA {
        X2 [shape=box];

      node [style=filled];
        1 -> 2 -> 3 -> X2 -> 5;
        6;
        7;
      label = "A";
      color=blue
    }
    X1 [shape=box];
    subgraph clusterB {
      node [style=filled];
        8;
        9;
        10 -> 11 -> 12;
        12 -> 9;
        12 -> 8 -> 13;
        13 -> 14;
      label = "B";
      color=blue
    }
    subgraph clusterC {
      label = "C";
      {
        node [style="invis"];
        gap;
      }
      node [shape=box];
      
      edge [style="invis"];
      X3 -> gap -> X4;           
    }
  
    14 -> X4 -> 3;
    6 -> X1 -> 10;
    { edge [dir="both"];
      8 -> X3 -> 7;
    }
    
    9 -> X3
  }

Questions / changes I would like to make:

  • I want the flow of nodes 10 -> 11 -> 12 -> 8 -> 13 -> 14 to be in a vertical line (swap 8 and 9 horizontally). How can I do this? (same with 1 -> 2 -> 3 -> X2 -> 5; swap 6 and 1)
  • I want X1 to be at the same vertical position as 10, and the same horizontal position as 6. How can I do this?
  • I want 8 and X3 and 7 to be at the same vertical position, also with 14 and X4 and 3. How can I do this?
  • The ranksep=0.3; statement works great except note that 8 -> 13 -> 14 has a larger gap, as does X3 -> gap -> X4. Why doesn’t it obey the ranksep=0.3 rule, and how do I fix this?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:11:13+00:00Added an answer on May 13, 2026 at 11:11 am

    Below is the best I can do: phantom nodes and edges help. But I can’t seem to encourage a particular ordering in the transverse direction (the other direction from rankdir).

    alt text

     digraph G {
        ranksep=0.3; size="6.0,6.0";
        rankdir=TB;
    
        node [fontsize=11];
    
        subgraph clusterA {
          X2 [shape=box];
          label = "A";
          color=blue;
    
          node [style=filled];
            /* force 1, 6, and 7 to be at the top together,
               add enough phantoms to keep things in nice columns */
            {
              node [style="invis", label=""]; 
              phantom3;
              phantom4;
              phantom5;
              phantom6;
            }
    
    
              rank = same;
              1 -> 2 -> 3 -> X2 -> 5;        
    
              edge [style="invis"];
              6 -> phantom3 -> phantom5;
              7 -> phantom4 -> phantom6;
    
        }
        subgraph clusterB {
          node [style=filled];
          label = "B";
          color=blue;
          /* create an invisible phantom node 
               to take up space */
          {
            node [style="invis",label=""];
            phantom1;
            phantom1b;
          }
    
          { rank=same; 11;
            phantom1;
          }
    
          10 -> 11 -> 12 -> 8 -> 13 -> 14;
          12 -> 9;
          phantom1 -> 9 -> phantom1b [style="invis"];
    
        }
    
    
        /* force X1 to be at the same vertical pos as 10
           (this yields a warning though) */
        { rank = same; 
          X1 [shape=box];
          10;
        }
    
        6 -> X1;
        X1 -> 10 [weight=0.5];
    
        subgraph clusterC {
          label = "C";
    
          phantom2 [style="invis", label=""];
    
          node [shape=box];
    
          edge [style="invis"];
          X3 -> phantom2 -> X4;           
        }
    
        9 -> X3 [weight=0.5];
    
        { 
          edge [weight=20];
          14 -> X4 -> 3;
          3 -> X4 -> 14 [style="invis"];
          /* add a reverse path so graphviz doesn't force 14 above X4 above 3 */
        }
        { 
          edge [dir="both", weight=20];
          8 -> X3 -> 7;
          7 -> X3 -> 8 [style="invis"];
          edge [style="invis"];
          X4 -> phantom6;
          1 -> phantom2;
          8 -> phantom2;
        }
    
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there a way to have the cobertura test coverage graph be shown on
I have a test site where I am building a d3-based force-directed network graph
I have a Test Class, that test the access of all page with different
I have a test sample about coherence lock-unlock mechanism like this: public class Test
I have a test project, with an App.config that sets up default values for
I have a Entity Framework design with a few tables that define a graph.
Here graph is higher-order function that returns a function with config set in its
I have a graph that auto fills based on a few values. The values
I'd like to be able to tag existing friends using the graph api: Here's
So basically, I have a test graph in JQuery-Flot, and instead of the normal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.