13

Is it possible to make a balloon-like shape in TikZ? Personally, I haven't found anything closer than an ellipse:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    \tikzstyle{balloon}=[ball color=red];    
    \shade[balloon] ellipse (2 and 1);
\end{tikzpicture}
\end{document}
6
  • You mean an inflatable balloon as opposed to a speech balloon I guess?
    – badroit
    Sep 19, 2013 at 14:41
  • Yes, indeed. It is meant as an illustration of a physical experiment involving a helium balloon.
    – Gaussler
    Sep 19, 2013 at 14:44
  • Everything’s possible but you need to specify the balloon’s path. You can use (ellipsoid) arcs, you can use to with specified angles, distances, looseness and such or directly specify a Bézier curve with the .. controls … .. operator. — On another node: Do you want to define a PGF shape (that can be used as a node similar to circle and rectangle) or do you only want to draw/fill a path shaped like a balloon? Sep 19, 2013 at 14:48
  • I only need a single drawing of a balloon, that's all... :-)
    – Gaussler
    Sep 19, 2013 at 14:54
  • I would go with hobby for this with some shading; a weakly related example is: Draw a closed liquid-droped shaped curve with TikZ. Sep 19, 2013 at 14:54

2 Answers 2

18

Without PSTricks.

\documentclass[tikz,border=12pt]{standalone}

\begin{document}
\begin{tikzpicture}
    \tikzstyle{balloon}=[ball color=red];    
    \shade[balloon] ellipse (1.75 and 2);
    \shade[balloon] (-.1,-2) -- (-.3,-2.2) -- (.3,-2.2) -- (.1,-2) -- cycle;
    \draw (0,-2.2) -- (0,-5);
\end{tikzpicture}
\end{document}

enter image description here

4

Surprisingly, we can do that with a very simple Bezier curve. The idea of including a small part below the knot is inspired by the other answer to this question. The draw command afterwards draws the rope.

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
  \shade[ball color=red] (-.08,-2.2) .. controls (2,0) and (-2,0) .. (.08,-2.2);
  \draw (0,-2.2) -- (0,-5);
\end{tikzpicture}
\end{document}

Result of the tikz code producing a floating balloon

1
  • 1
    Thanks for the great answer. I could really have used that ten years ago when I wrote that physics report. 😁
    – Gaussler
    Feb 10 at 11:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .