Quantcast

questions about subgraph

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

questions about subgraph

kfc123
Hi,
 I am using dot layout and have two subgraphs compounded in a bigraph.
They looks like

---------
|          |  _
|          | |_|
|_____|

since I use different arrow shape, I want to add a legend to show the
difference of arrow. I added the third subgraph for that purpose. Here
are the problems:

1) I want the legend pointing the left to right horizontally instead of
top to bottom vertically. I try to add rankdir=LR in the subgraph, no
help!

subgraph cluster_legend {
  rankdir=LR;
  ....
}

2) How can I force the subgraph move to the position I specify? Now, the
cluster_legend appear in northeast of the graph, how can I move it to
anywhere I want it to be?

Thanks in advance.
_______________________________________________
[hidden email]
https://mailman.research.att.com/mailman/listinfo/graphviz-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about subgraph

onion mantis
I am also interested the same two questions you mentioned.

I have a suggestion concerning the LEGEND:

The way I did it was as follows :

* The main graph was to be rendered using the DOT filter, and had
rankdir=TB (the default)

* in my case, the difference edges are given different colors rather
than different arrow shapes,

* of course rankdir does not work for subgraphs as it is an attribute
only for a Graph , so

Inside the subgraph cluster_Legend {} subgraph :

To produce a legend that looks like each line goes  from left to right ,

I set each line  for the legend to be composed of

one invisible node connected by the desired edge to a plaintext node
saying what the edge represents.

But both nodes have {rank = same}

I then connected the invisibled nodes  by an invisible edge that like
the parent graph
runs from Top to Bottom.

Here's an example, and apologies for the messiness of the syntax:


Example:

//LEGEND
subgraph clusterLegend {
label="Legend:" labelloc=t
centered=false
color=black
node  [shape=plaintext]

/* These node appear as the descriptions for each type of edge , they
are musical chords in my case*/
Major7
m7
"7th"
"1/2dim"
"7alt"
"7b9 from 3rd"
"7b9 from 7th"
"7+5"
"7+5 bis."


node [style=invis]
a b c d e f g h i

//This produces two columns for my legend subgraph
a -> b -> c -> d -> e [style=invis]
f -> g -> h -> i [style=invis]

{rank=same a -> Major7 [color=red]}
{rank=same b -> m7 [color=orange]}
{rank=same c -> "7th" [color=yellow]}
{rank=same d ->  "1/2dim" [color=darkorange3]}
{rank=same e ->  "7alt" [color=deepskyblue3]}
{rank=same f ->  "7b9 from 3rd" [color= darkseagreen4 ]}
{rank=same g ->  "7b9 from 7th" [color= darkseagreen2 ]}
{rank=same h ->  "7+5" [color= darkseagreen1 ]}
{rank=same i ->  "7+5 bis." [color= darkolivegreen1 ] }
}

This way each entry in the legend appears horizontal

Of course if the graph is rendered with rankdir=LR ,

then you should have no problem for the legend to also appear LR like
the parent graph.


Unfortunately I do not yet know how to position a given subgraph
within the graph.

Nor do I know how to give the entire graph a bounding box .

Best regards.



On Mon, May 19, 2008 at 9:00 PM,  <[hidden email]> wrote:

> Hi,
>  I am using dot layout and have two subgraphs compounded in a bigraph.
> They looks like
>
> ---------
> |          |  _
> |          | |_|
> |_____|
>
> since I use different arrow shape, I want to add a legend to show the
> difference of arrow. I added the third subgraph for that purpose. Here
> are the problems:
>
> 1) I want the legend pointing the left to right horizontally instead of
> top to bottom vertically. I try to add rankdir=LR in the subgraph, no
> help!
>
> subgraph cluster_legend {
>  rankdir=LR;
>  ....
> }
>
> 2) How can I force the subgraph move to the position I specify? Now, the
> cluster_legend appear in northeast of the graph, how can I move it to
> anywhere I want it to be?
>
> Thanks in advance.
> _______________________________________________
> [hidden email]
> https://mailman.research.att.com/mailman/listinfo/graphviz-interest
>
_______________________________________________
[hidden email]
https://mailman.research.att.com/mailman/listinfo/graphviz-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about subgraph

onion mantis
I include here an example png image for the output , to show you the
result , but it might not appear on the mailing list , in case it
thinks it is not valid content. Please find the image attached.



On Thu, May 22, 2008 at 12:39 AM, onion mantis <[hidden email]> wrote:

> I am also interested the same two questions you mentioned.
>
> I have a suggestion concerning the LEGEND:
>
> The way I did it was as follows :
>
> * The main graph was to be rendered using the DOT filter, and had
> rankdir=TB (the default)
>
> * in my case, the difference edges are given different colors rather
> than different arrow shapes,
>
> * of course rankdir does not work for subgraphs as it is an attribute
> only for a Graph , so
>
> Inside the subgraph cluster_Legend {} subgraph :
>
> To produce a legend that looks like each line goes  from left to right ,
>
> I set each line  for the legend to be composed of
>
> one invisible node connected by the desired edge to a plaintext node
> saying what the edge represents.
>
> But both nodes have {rank = same}
>
> I then connected the invisibled nodes  by an invisible edge that like
> the parent graph
> runs from Top to Bottom.
>
> Here's an example, and apologies for the messiness of the syntax:
>
>
> Example:
>
> //LEGEND
> subgraph clusterLegend {
> label="Legend:" labelloc=t
> centered=false
> color=black
> node  [shape=plaintext]
>
> /* These node appear as the descriptions for each type of edge , they
> are musical chords in my case*/
> Major7
> m7
> "7th"
> "1/2dim"
> "7alt"
> "7b9 from 3rd"
> "7b9 from 7th"
> "7+5"
> "7+5 bis."
>
>
> node [style=invis]
> a b c d e f g h i
>
> //This produces two columns for my legend subgraph
> a -> b -> c -> d -> e [style=invis]
> f -> g -> h -> i [style=invis]
>
> {rank=same a -> Major7 [color=red]}
> {rank=same b -> m7 [color=orange]}
> {rank=same c -> "7th" [color=yellow]}
> {rank=same d ->  "1/2dim" [color=darkorange3]}
> {rank=same e ->  "7alt" [color=deepskyblue3]}
> {rank=same f ->  "7b9 from 3rd" [color= darkseagreen4 ]}
> {rank=same g ->  "7b9 from 7th" [color= darkseagreen2 ]}
> {rank=same h ->  "7+5" [color= darkseagreen1 ]}
> {rank=same i ->  "7+5 bis." [color= darkolivegreen1 ] }
> }
>
> This way each entry in the legend appears horizontal
>
> Of course if the graph is rendered with rankdir=LR ,
>
> then you should have no problem for the legend to also appear LR like
> the parent graph.
>
>
> Unfortunately I do not yet know how to position a given subgraph
> within the graph.
>
> Nor do I know how to give the entire graph a bounding box .
>
> Best regards.
>
>
>
> On Mon, May 19, 2008 at 9:00 PM,  <[hidden email]> wrote:
>> Hi,
>>  I am using dot layout and have two subgraphs compounded in a bigraph.
>> They looks like
>>
>> ---------
>> |          |  _
>> |          | |_|
>> |_____|
>>
>> since I use different arrow shape, I want to add a legend to show the
>> difference of arrow. I added the third subgraph for that purpose. Here
>> are the problems:
>>
>> 1) I want the legend pointing the left to right horizontally instead of
>> top to bottom vertically. I try to add rankdir=LR in the subgraph, no
>> help!
>>
>> subgraph cluster_legend {
>>  rankdir=LR;
>>  ....
>> }
>>
>> 2) How can I force the subgraph move to the position I specify? Now, the
>> cluster_legend appear in northeast of the graph, how can I move it to
>> anywhere I want it to be?
>>
>> Thanks in advance.
>> _______________________________________________
>> [hidden email]
>> https://mailman.research.att.com/mailman/listinfo/graphviz-interest
>>
>

_______________________________________________
[hidden email]
https://mailman.research.att.com/mailman/listinfo/graphviz-interest

graphWithLegend.png (68K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about subgraph

Pander-2
Hi all,

Many times I have had to make my own legen or colophon in Graphviz
graphs. Perhaps we could discuss a genenral format for this and submit
it as feature request. Any ideas?

Regards,

Pander

onion mantis wrote:

> I include here an example png image for the output , to show you the
> result , but it might not appear on the mailing list , in case it
> thinks it is not valid content. Please find the image attached.
>
>
>
> On Thu, May 22, 2008 at 12:39 AM, onion mantis <[hidden email]> wrote:
>> I am also interested the same two questions you mentioned.
>>
>> I have a suggestion concerning the LEGEND:
>>
>> The way I did it was as follows :
>>
>> * The main graph was to be rendered using the DOT filter, and had
>> rankdir=TB (the default)
>>
>> * in my case, the difference edges are given different colors rather
>> than different arrow shapes,
>>
>> * of course rankdir does not work for subgraphs as it is an attribute
>> only for a Graph , so
>>
>> Inside the subgraph cluster_Legend {} subgraph :
>>
>> To produce a legend that looks like each line goes  from left to right ,
>>
>> I set each line  for the legend to be composed of
>>
>> one invisible node connected by the desired edge to a plaintext node
>> saying what the edge represents.
>>
>> But both nodes have {rank = same}
>>
>> I then connected the invisibled nodes  by an invisible edge that like
>> the parent graph
>> runs from Top to Bottom.
>>
>> Here's an example, and apologies for the messiness of the syntax:
>>
>>
>> Example:
>>
>> //LEGEND
>> subgraph clusterLegend {
>> label="Legend:" labelloc=t
>> centered=false
>> color=black
>> node  [shape=plaintext]
>>
>> /* These node appear as the descriptions for each type of edge , they
>> are musical chords in my case*/
>> Major7
>> m7
>> "7th"
>> "1/2dim"
>> "7alt"
>> "7b9 from 3rd"
>> "7b9 from 7th"
>> "7+5"
>> "7+5 bis."
>>
>>
>> node [style=invis]
>> a b c d e f g h i
>>
>> //This produces two columns for my legend subgraph
>> a -> b -> c -> d -> e [style=invis]
>> f -> g -> h -> i [style=invis]
>>
>> {rank=same a -> Major7 [color=red]}
>> {rank=same b -> m7 [color=orange]}
>> {rank=same c -> "7th" [color=yellow]}
>> {rank=same d ->  "1/2dim" [color=darkorange3]}
>> {rank=same e ->  "7alt" [color=deepskyblue3]}
>> {rank=same f ->  "7b9 from 3rd" [color= darkseagreen4 ]}
>> {rank=same g ->  "7b9 from 7th" [color= darkseagreen2 ]}
>> {rank=same h ->  "7+5" [color= darkseagreen1 ]}
>> {rank=same i ->  "7+5 bis." [color= darkolivegreen1 ] }
>> }
>>
>> This way each entry in the legend appears horizontal
>>
>> Of course if the graph is rendered with rankdir=LR ,
>>
>> then you should have no problem for the legend to also appear LR like
>> the parent graph.
>>
>>
>> Unfortunately I do not yet know how to position a given subgraph
>> within the graph.
>>
>> Nor do I know how to give the entire graph a bounding box .
>>
>> Best regards.
>>
>>
>>
>> On Mon, May 19, 2008 at 9:00 PM,  <[hidden email]> wrote:
>>> Hi,
>>>  I am using dot layout and have two subgraphs compounded in a bigraph.
>>> They looks like
>>>
>>> ---------
>>> |          |  _
>>> |          | |_|
>>> |_____|
>>>
>>> since I use different arrow shape, I want to add a legend to show the
>>> difference of arrow. I added the third subgraph for that purpose. Here
>>> are the problems:
>>>
>>> 1) I want the legend pointing the left to right horizontally instead of
>>> top to bottom vertically. I try to add rankdir=LR in the subgraph, no
>>> help!
>>>
>>> subgraph cluster_legend {
>>>  rankdir=LR;
>>>  ....
>>> }
>>>
>>> 2) How can I force the subgraph move to the position I specify? Now, the
>>> cluster_legend appear in northeast of the graph, how can I move it to
>>> anywhere I want it to be?
>>>
>>> Thanks in advance.
>>> _______________________________________________
>>> [hidden email]
>>> https://mailman.research.att.com/mailman/listinfo/graphviz-interest
>>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> [hidden email]
>> https://mailman.research.att.com/mailman/listinfo/graphviz-interest

_______________________________________________
[hidden email]
https://mailman.research.att.com/mailman/listinfo/graphviz-interest
Loading...