¿Puedo dibujar mis gráficas (teoría de grafos) con TikZ online?

¿Puedo dibujar mis gráficas (teoría de grafos) con TikZ online?

Tengo un problema, soy estudiante de maestría y estoy escribiendo mi tesis (teoría de grafos) en LaTeX.

¿Alguien puede ayudarme a encontrar un sitio web en línea para dibujar gráficos y luego insertar el código en LaTeX en línea?

Respuesta1

A continuación se muestra un ejemplo del uso del paquete igraph en R e incrustación del resultado en un archivo pdf usando knitr y pdflatex. Dependiendo de su sistema operativo y configuración, los detalles reales del flujo de trabajo pueden variar.

En general, 1) cree el archivo látex con los comandos R integrados. Guarde esto con la extensión *.Rnw (distingue entre mayúsculas y minúsculas) 2) ahora use R para ejecutar el comando knit en este archivo *.Rnw. No obtendrá un archivo *.tex con el mismo nombre base que el archivo *.Rnw original. 3) Ejecute pdflatex y luego vea el archivo *.pdf.

Aquí hay un archivo fuente de ejemplo (extraído dehttp://www.r-graph-gallery.com/247-network-chart-layouts/).

\documentclass[10pt,letterpaper]{article}
\begin{document}
Demo of Graph Theory using R and Tikz
<<>>=
# library
library(igraph)

# Create data
data=matrix(sample(0:1, 400, replace=TRUE, prob=c(0.8,0.2)), nrow=20)
network=graph_from_adjacency_matrix(data , mode='undirected', diag=F )

# When ploting, we can use different layouts:
par(mfrow=c(2,2), mar=c(1,1,1,1))
plot(network, layout=layout.sphere, main="sphere")
plot(network, layout=layout.circle, main="circle")
plot(network, layout=layout.random, main="random")
plot(network, layout=layout.fruchterman.reingold, main="fruchterman.reingold")
@
\end{document}

Y resulta en

ingrese la descripción de la imagen aquí

Respuesta2

Podrías considerar registrarte gratisNube sabiacuenta que te brinda el poder del sistema de álgebra informática Sage junto con el sagetexpaquete en LaTeX; documentaciónaquí. Sage tiene conocimientos de teoría de grafos; Por ejemplográficos nombrados,parámetros del gráfico, e inclusoOpciones de látex. Eso significa que puedes crear tus gráficos usando tikzo usar el poder de Sage para cuidar los detalles. He aquí un ejemplo:

\documentclass{article}
\usepackage{sagetex}
\usepackage{tikz,tkz-graph,tkz-berge}
\thispagestyle{empty}
\begin{document}
Here's a graph where you specify the position of the vertices. Note that  the label is placed inside unless specified:\\\\
\begin{center}
\begin{tikzpicture}[scale=1.5]
\renewcommand*{\VertexLineWidth}{1pt}%vertex thickness
\renewcommand*{\EdgeLineWidth}{1pt}% edge thickness
\GraphInit[vstyle=Normal]
\Vertex[Lpos=270,L=$v_1$,x=0,y=0]{R1}
\Vertex[LabelOut,Lpos=270,L=$v_2$,x=0,y=2]{R2}
\Vertex[LabelOut,Lpos=270,L=$v_3$,x=1,y=1]{R3}
\Vertex[LabelOut,Lpos=270,L=$v_4$,x=2,y=1]{R4}
\Vertex[LabelOut,Lpos=270,L=$v_5$,x=3,y=1]{R5}
\Vertex[LabelOut,Lpos=270,L=$v_6$,x=4,y=1]{R6}
\Vertex[LabelOut,Lpos=90,L=$v_7$,x=3,y=2]{R7}
\Vertex[LabelOut,Lpos=90,L=$v_8$,x=4,y=2]{R8}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Edge (R3)(R4)
\Edge (R3)(R1)
\Edge (R2)(R3)
\Edge (R5)(R4)
\Edge (R5)(R6)
\Edge (R5)(R7)
\Edge (R6)(R8)
\Edge (R7)(R8)
\end{tikzpicture}
\end{center}

But \textsf{Sage} has knowledge of graph theory and you can use it to specify graphs
and determine various characteristics. For example:\\\\
\begin{sagesilent}
H= graphs.PetersenGraph()
H.set_latex_options(scale=3.5,graphic_size=(2.1,2.1))
Chi = H.chromatic_number(algorithm="DLX")
Beta = H.independent_set()
\end{sagesilent}
\noindent The Petersen graph below has $\sage{H.order()}$ vertices and
$\sage{H.size()}$ edges.\\\\
\begin{center}
\begin{tikzpicture}
\GraphInit[vstyle=Normal]
\SetVertexNormal[Shape=circle,LineWidth = 1pt]
\tikzset{EdgeStyle/.append style = {color = blue!60, line width=1pt}}
\sage{H}
\end{tikzpicture}
\end{center}
\vspace{5pt}
The chromatic number is $\chi(G)=\sage{Chi}$. The maximum size independent 
set is $\beta(G)=\sage{len(Beta)}$. One such set is $\sage{Beta}$. The 
maximum size clique has $\omega(G)=\sage{H.clique_number()}$ vertices; 
e.g., $\sage{H.clique_maximum()}$. The diameter is $\sage{H.diameter()}$
and the radius is $\sage{H.radius()}$.
\end{document}

El resultado que se ejecuta en Sagemath Cloud es:ingrese la descripción de la imagen aquí

Si amplía la imagen, encontrará que Sage ha calculado los parámetros del gráfico por usted, una buena forma de evitar errores en un documento importante.

Respuesta3

Puedes exportar cualquier cosa dibujada en Geogebra como código tikz, mira este tutorial,https://www.sharelatex.com/blog/2013/08/28/tikz-series-pt2.html

información relacionada