
Soy muy nuevo en Tex y estoy tratando de dibujar un gráfico usando el paquete tikz.
Así que aquí está el código que escribí.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\ifx\du\undefined
\newlength{\du}
\fi
\setlength{\du}{15\unitlength}
\begin{tikzpicture}
\pgftransformxscale{1}
\pgftransformyscale{-1}
\pgfsetlinewidth{0.1\du}
\draw (0\du,0\du)--(13\du,-13\du);
\draw (0\du,0\du)--(4\du,-1\du);
\draw (4\du,-1\du)--(9\du,-5\du);
\draw (9\du,-5\du)--(11\du,-8\du);
\draw (11\du,-8\du)--(13\du,-13\du);
\node[anchor=west] at (7\du,-5\du){some text};
\end{tikzpicture}
\end{document}
Estoy tratando de llenar el área delimitada por estas líneas y también tener "algo de texto" visible.
¿Alguien podría ayudar, por favor?
Respuesta1
Según puedo entender lo que estás buscando, aquí tienes una solución: eliminar estas líneas pgf de bajo nivel innecesarias y modificar las coordenadas y en consecuencia para evitar esto.y transformar la forma.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\ifx\du\undefined
\newlength{\du}
\fi
\setlength{\du}{15\unitlength}
\begin{tikzpicture}
\draw[line width=0.1\du, fill=pink] (0\du,0\du)--(13\du,13\du) -- (11\du,8\du) -- (9\du,5\du) -- (4\du,1\du) -- cycle;
\node at (7\du,5\du){some text};
\end{tikzpicture}
\end{document}
Respuesta2
\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\newcommand{\du}{15pt}
\draw[fill=cyan,very thick] (0,0) -- (13*\du,13*\du) -- (11*\du,8*\du) -- (9*\du,5*\du) -- (4*\du,\du) -- cycle;
\node[anchor=west, red, font=\large] at (7*\du,5*\du){some text};
\end{tikzpicture}
\end{document}