LaTeX forum ⇒ Graphics, Figures & TablestikZ | Fitting Shape around Mindmap Objects

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

tikZ | Fitting Shape around Mindmap Objects

Postby Weihnachtsmann » Sun Oct 07, 2012 1:43 pm

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?

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

Postby Weihnachtsmann » Sun Oct 07, 2012 2:25 pm

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.

  1. \RequirePackage{tikz}
  2. \usetikzlibrary{fit}
  3. \usetikzlibrary[plothandlers]
  4.  
  5. \documentclass{article}%,
  6. \begin{document}
  7. \begin{tikzpicture}
  8. \draw[gray] (0,0) node (x) {x} (1,1) node (y) {y} (2,0) node (z) {z} (1,.5) node (m) {m};
  9. \pgfplothandlerclosedcurve
  10. \pgfplotstreamstart
  11. \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  12. \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  13. \pgfplotstreampoint{\pgfpoint{2cm}{0cm}}
  14. \pgfplotstreamend
  15. \pgfusepath{stroke}
  16. \node[ draw=gray, fit= (x)(y)(m)(z) , inner sep=0] (djk) {} ;
  17. \end{tikzpicture}
  18. \end{document}
Last edited by cgnieder on Sun Oct 07, 2012 2:49 pm, edited 2 times in total.
Reason: added inline code markup


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests