demo/graph_to_eps_demo.cc
changeset 1943 7349b09373a0
parent 1875 98698b69a902
child 1956 a055123339d5
equal deleted inserted replaced
6:406c31860413 7:e5840eba6e1b
    77   e=g.addEdge(n3,n4); ecolors[e]=2; widths[e]=1;
    77   e=g.addEdge(n3,n4); ecolors[e]=2; widths[e]=1;
    78   
    78   
    79   IdMap<ListGraph,Node> id(g);
    79   IdMap<ListGraph,Node> id(g);
    80 
    80 
    81   cout << "Create 'graph_to_eps_demo_out.eps'" << endl;
    81   cout << "Create 'graph_to_eps_demo_out.eps'" << endl;
    82   graphToEps(g,"graph_to_eps_demo_out.eps").scale(10).coords(coords).
    82   graphToEps(g,"graph_to_eps_demo_out.eps").
       
    83     //scale(10).
       
    84     coords(coords).
    83     title("Sample .eps figure").
    85     title("Sample .eps figure").
    84     copyright("(C) 2006 LEMON Project").
    86     copyright("(C) 2006 LEMON Project").
    85     nodeScale(2).nodeSizes(sizes).
    87     nodeScale(2).nodeSizes(sizes).
    86     nodeShapes(shapes).
    88     nodeShapes(shapes).
    87     nodeColors(composeMap(colorSet,colors)).
    89     nodeColors(composeMap(colorSet,colors)).
    90     nodeTexts(id).nodeTextSize(3).
    92     nodeTexts(id).nodeTextSize(3).
    91     run();
    93     run();
    92 
    94 
    93 
    95 
    94   cout << "Create 'graph_to_eps_demo_out_arr.eps'" << endl;
    96   cout << "Create 'graph_to_eps_demo_out_arr.eps'" << endl;
    95   graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).
    97   graphToEps(g,"graph_to_eps_demo_out_arr.eps").
       
    98     //scale(10).
    96     title("Sample .eps figure (with arrowheads)").
    99     title("Sample .eps figure (with arrowheads)").
    97     copyright("(C) 2006 LEMON Project").
   100     copyright("(C) 2006 LEMON Project").
    98     nodeColors(composeMap(colorSet,colors)).
   101     nodeColors(composeMap(colorSet,colors)).
    99     coords(coords).
   102     coords(coords).
   100     nodeScale(2).nodeSizes(sizes).
   103     nodeScale(2).nodeSizes(sizes).
   115   e=g.addEdge(n1,n2); ecolors[e]=5; widths[e]=1;
   118   e=g.addEdge(n1,n2); ecolors[e]=5; widths[e]=1;
   116   e=g.addEdge(n1,n2); ecolors[e]=6; widths[e]=1;
   119   e=g.addEdge(n1,n2); ecolors[e]=6; widths[e]=1;
   117   e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
   120   e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
   118 
   121 
   119   cout << "Create 'graph_to_eps_demo_out_par.eps'" << endl;
   122   cout << "Create 'graph_to_eps_demo_out_par.eps'" << endl;
   120   graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
   123   graphToEps(g,"graph_to_eps_demo_out_par.eps").
       
   124     //scale(10).
   121     title("Sample .eps figure (parallel edges)").
   125     title("Sample .eps figure (parallel edges)").
   122     copyright("(C) 2006 LEMON Project").
   126     copyright("(C) 2006 LEMON Project").
   123     nodeShapes(shapes).
   127     nodeShapes(shapes).
   124     coords(coords).
   128     coords(coords).
   125     nodeScale(2).nodeSizes(sizes).
   129     nodeScale(2).nodeSizes(sizes).
   129     nodeTexts(id).nodeTextSize(3).
   133     nodeTexts(id).nodeTextSize(3).
   130     enableParallel().parEdgeDist(1.5).
   134     enableParallel().parEdgeDist(1.5).
   131     run();
   135     run();
   132   
   136   
   133   cout << "Create 'graph_to_eps_demo_out_par_arr.eps'" << endl;
   137   cout << "Create 'graph_to_eps_demo_out_par_arr.eps'" << endl;
   134   graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).
   138   graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").
       
   139     //scale(10).
   135     title("Sample .eps figure (parallel edges and arrowheads)").
   140     title("Sample .eps figure (parallel edges and arrowheads)").
   136     copyright("(C) 2006 LEMON Project").
   141     copyright("(C) 2006 LEMON Project").
   137     nodeScale(2).nodeSizes(sizes).
   142     nodeScale(2).nodeSizes(sizes).
   138     coords(coords).
   143     coords(coords).
   139     nodeShapes(shapes).
   144     nodeShapes(shapes).
   170     hcoords[n]=Xy(i%cols,i/cols);
   175     hcoords[n]=Xy(i%cols,i/cols);
   171     hcolors[n]=i;
   176     hcolors[n]=i;
   172   }
   177   }
   173   
   178   
   174   cout << "Create 'graph_to_eps_demo_out_colors.eps'" << endl;
   179   cout << "Create 'graph_to_eps_demo_out_colors.eps'" << endl;
   175   graphToEps(h,"graph_to_eps_demo_out_colors.eps").scale(60).
   180   graphToEps(h,"graph_to_eps_demo_out_colors.eps").
       
   181     //scale(60).
   176     title("Sample .eps figure (ColorSet demo)").
   182     title("Sample .eps figure (ColorSet demo)").
   177     copyright("(C) 2006 LEMON Project").
   183     copyright("(C) 2006 LEMON Project").
   178     coords(hcoords).
   184     coords(hcoords).
   179     nodeScale(.45).
   185     nodeScale(.45).
   180     distantColorNodeTexts().
   186     distantColorNodeTexts().