Graphics, Figures & TablestikZ | Fitting Shape around Mindmap Objects

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Weihnachtsmann
Posts: 7
Joined: Sun Oct 07, 2012 1:17 pm

tikZ | Fitting Shape around Mindmap Objects

Post by Weihnachtsmann »

Hi,

I have a mindmap with many objects and I would like to draw a shape arround certain objects. The shape should include all marked objects (as fit= (..) (..) (..)) does, but flow around the objects like \pgfplothandlerclosedcurve.

Can you help me with this issue, please?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Weihnachtsmann
Posts: 7
Joined: Sun Oct 07, 2012 1:17 pm

tikZ | Fitting Shape around Mindmap Objects

Post by Weihnachtsmann »

Here is a working example. I want to make \pgfplothandlerclosedcurve work like fit does. Therfore two steps would be required:
a) Make \pgfplothandlerclosedcurve accept labels such as (x) instead of \pgfpoint{..}{..}
b) Ignore nodes in the middle like m in my example.

I hope this helps a bit.

Code: Select all

\RequirePackage{tikz}
\usetikzlibrary{fit}
\usetikzlibrary[plothandlers] 

\documentclass{article}%,
\begin{document}
\begin{tikzpicture}
  \draw[gray] (0,0) node (x) {x} (1,1) node (y) {y} (2,0) node (z) {z} (1,.5) node (m) {m};
  \pgfplothandlerclosedcurve
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0cm}}
   \pgfplotstreamend
  \pgfusepath{stroke}
  \node[ draw=gray, fit= (x)(y)(m)(z) , inner sep=0] (djk) {}   ;
\end{tikzpicture}
\end{document}
Last edited by cgnieder on Sun Oct 07, 2012 2:49 pm, edited 2 times in total.
Post Reply