I would like to create the following image in tikz.

enter image description here

I am completely new to it, so I tried to change the code at http://www.texample.net/tikz/examples/free-body-diagrams/



    axis/.style={densely dashed,gray,font=\small},
    M/.style={rectangle,draw,fill=lightgray,minimum size=0.5cm,thin},
    m/.style={rectangle,draw=black,fill=lightgray,minimum size=0.3cm,thin},
    string/.style={draw=red, thick},

\matrix[column sep=1cm] {
   \draw[plane] (0,-1) coordinate (base)
                     -- coordinate[pos=0.5] (mid) ++(\iangle:3) coordinate (top)
                     |- (base) -- cycle;
    \path (mid) node[M,rotate=\iangle,yshift=0.5cm] (M) {};
    % Free body diagram of M2 pulley
    \draw[pulley] (top) -- ++(\iangle:0.25) circle (0.5cm)
                   ++ (90-\iangle:0.5) coordinate (pulley);
    \draw[string] (M.east) -- ++(\iangle:2.0cm) arc (90+\iangle:0:0.25)
                  -- ++(0,-1) node[m] {};

but I am not close. Some basic pointers would be appreciated.

  • A matrix is used to align an array of nodes. You definitely don't want \draws inside. (base), (mid) and (top) are undefined. – John Kormylo Sep 26 '18 at 13:03

Something like this:

enter image description here

Here is the code:


   \draw[thick] (0,0) circle (10mm);


The \usetikzlibrary{arrows.meta} and >=Latex are to give the latex arrow heads in the OP.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.