Anuncio

Colapsar
No hay ningún anuncio todavía.

¿Cómo crear este tipo de diagramas?

Colapsar
X
 
  • Filtro
  • Hora
  • Mostrar
Borrar todo
nuevos mensajes

  • ¿Cómo crear este tipo de diagramas?

    Buenas.

    Me gustaría saber crear gráficas como esta para insertarlas en un trabajo, me gustaría tener un resultado vectorial, ya sea svg, pdf o directamente algo de Latex.
    Algo como esto con una letra en cada nodo, con los nodos alineados, ya sea en diagonal o horizontal:

    Haz clic en la imagen para ampliar

Nombre:	E2XxW.jpg
Vitas:	1
Tamaño:	23,0 KB
ID:	314797

    He probado un montón de herramientas, desde Inkscape hasta generadores de gráficos Tikz o latexdraw, y paquetes de R como visnetwork (que tiene la ventaja de hacerlo todo automáticamente) y todos tienen algún problema, o no te dejan poner las curvas como quieres o algo, o no permiten alinear los nodos o crear curvas adecuadamente.


    Pregunté esta misma pregunta en stackoverlow
    https://stackoverflow.com/questions/...ned-nodes-in-r
    pero pidiendo alguna solución con librerías de grafos de R pero no parece que haya una opción mejor que esta con igraph, que queda muy cutre:
    Código:
    [FONT=inherit]library[/FONT][FONT=inherit]([/FONT][FONT=inherit]igraph[/FONT][FONT=inherit])[/FONT][FONT=inherit]EL [/FONT][FONT=inherit]=[/FONT][FONT=inherit] cbind[/FONT][FONT=inherit]([/FONT][FONT=inherit]from[/FONT][FONT=inherit],[/FONT][FONT=inherit] to[/FONT][FONT=inherit])[/FONT][FONT=inherit]
    g [/FONT][FONT=inherit]=[/FONT][FONT=inherit] graph_from_edgelist[/FONT][FONT=inherit]([/FONT][FONT=inherit]EL[/FONT][FONT=inherit])[/FONT][FONT=inherit]
    
    L [/FONT][FONT=inherit]=[/FONT][FONT=inherit] cbind[/FONT][FONT=inherit]([/FONT][FONT=inherit]1[/FONT][FONT=inherit]:[/FONT][FONT=inherit]5[/FONT][FONT=inherit],[/FONT][FONT=inherit]5[/FONT][FONT=inherit]:[/FONT][FONT=inherit]1[/FONT][FONT=inherit])[/FONT][FONT=inherit]
    CURVE [/FONT][FONT=inherit]=[/FONT][FONT=inherit] c[/FONT][FONT=inherit]([/FONT][FONT=inherit]0[/FONT][FONT=inherit],[/FONT][FONT=inherit]0.15[/FONT][FONT=inherit],[/FONT][FONT=inherit]0.3[/FONT][FONT=inherit],[/FONT][FONT=inherit]0.45[/FONT][FONT=inherit],[/FONT][FONT=inherit]0[/FONT][FONT=inherit],[/FONT][FONT=inherit]-0.15[/FONT][FONT=inherit],[/FONT][FONT=inherit]-0.3[/FONT][FONT=inherit],[/FONT][FONT=inherit]0[/FONT][FONT=inherit],[/FONT][FONT=inherit]0.15[/FONT][FONT=inherit],[/FONT][FONT=inherit]0[/FONT][FONT=inherit])[/FONT][FONT=inherit]plot[/FONT][FONT=inherit]([/FONT][FONT=inherit]g[/FONT][FONT=inherit],[/FONT][FONT=inherit] layout[/FONT][FONT=inherit]=[/FONT][FONT=inherit]L[/FONT][FONT=inherit],[/FONT][FONT=inherit] edge.curved[/FONT][FONT=inherit]=[/FONT][FONT=inherit]CURVE[/FONT][FONT=inherit])[/FONT]
    Haz clic en la imagen para ampliar

Nombre:	UY2dj.jpg
Vitas:	1
Tamaño:	10,2 KB
ID:	314796

    Al final creo que lo mejor va a ser hacerlo directamente con comandos de algún paquete con algún paquete de Latex. Que además permitirá modificar rápidamente futuras gráficas.

    ¿Podría alguien por favor darme un ejemplo simple de como hacerlo?
    Además me gusta mucho el efecto de la primera gráfica de "cortar" las flechas que se cruzan y de no llegar a tocar los nodos.

    Saludos
    Última edición por skan; 06/10/2017, 17:27:22.

Contenido relacionado

Colapsar

Trabajando...
X