Re: [graphviz-interest] Dendrograms/Cladograms
[email protected] Thu, 24 Dec 2015 13:00:50 +0100
| Newsgroups | gmane.comp.video.graphviz |
|---|---|
| Message-ID | <20151224130050.Horde.qj0_cAfCwXl6BgKgMp4c8Q7@webmail.stamm-wilbrandt.de> |
Following up on the differences between "pic" and "graphviz" I did a
little comparison on how to display complete bipartite graph on 2x3
nodes with both layout tools.
I am just a very beginner with "pic", so it may be done simpler than I
did, this is what I came up with:
.PS 5
.ps 12
A: box "A"
line invis
B: box "B"
line invis
C: box "C"
line up from top of A
D: box "1"
line up from top of B
E: box "2"
line up from top of C
F: box "3"
line from A.ne to E.sw
line from A.ne to F.sw
line from B.nw to D.se
line from B.ne to F.sw
line from C.nw to D.se
line from C.nw to E.se
.PE
At least the way I did it I had to provide basically the complete
layout myself.
This is K33 in ".dot" format for "graphviz" ([1] for playing):
graph K33 {
size="4,4" node [shape=box]
{A B C} -- {1 2 3}
}
Here complete layout is done by "graphviz", you can see both layouts here:
https://stamm-wilbrandt.de/en/forum/K33.gif
Hermann.
[1]
https://stamm-wilbrandt.de/GraphvizFiddle/?1450958184595#graph%20K33%20%7B%0A%20%20size%3D%224%2C4%22%20%20node%20%5Bshape%3Dbox%5D%0A%0A%20%20%7BA%20B%20C%7D%20--%20%7B1%202%203%7D%0A%7D%0A
Quoting [email protected]:
> Thank you Steve, I was not aware of pic.
>
> And it is installed on my Linux and the needed troff as well.
> It took some minutes to figure out how to generate .pdf from your
> .pic, this worked:
>
> $ pic cladogram.pic | groff | ps2pdf - > cladogram.pdf
> $
>
> For those without pic installed, here is the (nice) result:
> https://stamm-wilbrandt.de/en/forum/cladogram.pdf
>
> It seems the main difference between Graphviz and pic is that
> Graphviz does the full layout while pic does some part of the
> layout, but many details have to be provided by .pic input (like
> "lienwid*2", "linewid*3", ".c", ".w", ...) which is more fine grain
> construction?
>
> Hermann.
>
> Quoting steve roush <[email protected]>:
>
>> If we add {rank=same; A B C D;}, to the mix we can get the text
>> to line up. But even after lots of fiddling, I could not get it to
>> look ready-for-publication.
>> For fun, I decided to try it in PIC (compiled it to svg with pic2plot)
>> - http://www.cs.bell-labs.com/10thEdMan/pic.pdf
>> - https://en.wikipedia.org/wiki/Pic_language
>> -
>> https://www.gnu.org/software/plotutils/manual/en/html_node/pic2plot-Introduction.html
>>
>> Works like a champ & easy to automate
>>
>> steve roush
>>
>>> .PS
>>> down
>>>
>>> A: box invis " beetles" ljust
>>> B: box invis " wasps, bees ants" ljust
>>> C: box invis " butterflies, moths" ljust
>>> D: box invis " flies" ljust
>>>
>>> linewid=linewid*.75
>>>
>>> L1: line left linewid from D.c
>>>
>>> L2: line left linewid from C.c
>>> L3: line from L1.w to L2.w
>>> L4: line left from L3.c
>>>
>>> L5: line left linewid*2 from B.c
>>> L6: line from L4.w to L5.w
>>> L7: line left from L6.c
>>>
>>> L8: line left linewid*3 from A.c
>>> L9: line from L7.w to L8.w
>>> L10: line left from L9.c
>>> .PE
>>>
>>>
>>
>> On 12/22/2015 2:41 AM, [email protected] wrote:
>>> Hi,
>>>
>>> based on horizontal cladogram sample in [0] I came up with [1] and [2].
>>>
>>> I found no way to enforce the vertical order in [1] and therefore
>>> the edges are bottom up compared to sample.
>>>
>>> While [2] gives ortho edges the result does not look nicely ...
>>>
>>> Please play with it, if you have something interesting you can
>>> just click on "Share" button and copy the generated URL from
>>> address bar for sharing.
>>>
>>> Hermann.
>>>
>>> [0]
>>> https://en.wikipedia.org/wiki/Cladogram
>>>
>>> [1]
>>> http://stamm-wilbrandt.de/GraphvizFiddle/?1450776920582#digraph%20G%20%7B%0A%20rankdir%3DLR%0A%20%7B%20node%20%5Bshape%3Dpoint%20label%3D%22%22%5D%20z%20a%20b%20c%20%7D%0A%20node%20%5Bshape%3Dnone%5D%0A%20A%20%5Blabel%3D%22beetles%22%5D%0A%20B%20%5Blabel%3D%22wasps%2C%20bees%2C%20ants%22%5D%0A%20C%20%5Blabel%3D%22butterflies%2C%20moths%22%5D%0A%20D%20%5Blabel%3D%22flies%22%5D%0A%20z%20-%3E%20a%0A%20a%20-%3E%20%7B%20A%20b%20%7D%0A%20b%20-%3E%20%7B%20B%20c%20%7D%0A%20c%20-%3E%20%7B%20C%20D%20%7D%0A%7D%0A
>>> [2]
>>> http://stamm-wilbrandt.de/GraphvizFiddle/1.0.1/?1450777102156#digraph%20G%20%7B%0A%20rankdir%3DLR%20splines%3Dortho%0A%20%7B%20node%20%5Bshape%3Dpoint%20label%3D%22%22%5D%20z%20a%20b%20c%20%7D%0A%20node%20%5Bshape%3Dnone%5D%0A%20A%20%5Blabel%3D%22beetles%22%5D%0A%20B%20%5Blabel%3D%22wasps%2C%20bees%2C%20ants%22%5D%0A%20C%20%5Blabel%3D%22butterflies%2C%20moths%22%5D%0A%20D%20%5Blabel%3D%22flies%22%5D%0A%20z%20-%3E%20a%0A%20a%20-%3E%20%7B%20A%20b%20%7D%0A%20b%20-%3E%20%7B%20B%20c%20%7D%0A%20c%20-%3E%20%7B%20C%20D%20%7D%0A%7D%0A Quoting Ron Savage
>>> <[email protected]>:
>>>
>>>> Hi
>>>>
>>>> There's a dendrogram/cladogram [1] half-way down this page:
>>>> http://phenomena.nationalgeographic.com/2015/12/11/paleo-profile-the-smoke-hill-bird/ Can dot do anything like that or do I need to write a wrapper fabricating invisible nodes to generate the straight
>>>> lines?
>>>>
>>>> Normally, I'd search your site, but it's off-line from my POV
>>>> here in Melbourne, Australia :-(.
>>>>
>>>> [1] https://en.wikipedia.org/wiki/Cladogram
>>>>
>>>> --
>>>> Ron Savage - savage.net.au
>>>> _______________________________________________
>>>> [email protected]
>>>> http://lists.research.att.com/mailman/listinfo/graphviz-interest
>>>
>>>
>>>
>
> _______________________________________________
> [email protected]
> http://lists.research.att.com/mailman/listinfo/graphviz-interest
_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest