I am attempting to generate the following diagram in latex:

enter image description here

I've been using the tikz package, which although its capabilities seem to be endless, it does have a rather steep learning curve. I am currently learning how to generate simple diagrams including circles, arrows, squares, and have no idea how to include text yet. I am working through the manual so I will eventually have a good understanding of the tool, but as of yet, the diagram shown is beyond my capabilities. Could someone specify how I should go around generating this diagram? Many thanks for your help.

  • 2
    Could you describe more specifically what exactly your question is? As it stands now, it looks a bit like a "please solve my problem" question unlikely to be helpful to future visitors. If you continue working through the manual, you will find out how to draw a diagram like this one (it's not very complicated). – gerrit Dec 11 '12 at 15:08
  • I think you can start looking at the pgfmanual for the cylinder shape. :) – Claudio Fiandrino Dec 11 '12 at 15:12
  • Thank you for your comments. Yes, I agree that working through the manual is best, but I am currently on page 38 of the manual and I need to submit some work to my supervisor this evening. Although the diagram is not necessary, it does help illustrate some aspects of my work. My question was basically for someone to show me how to structure all the different shapes and text into one environment. – KatyB Dec 11 '12 at 15:44
  • @Kate I have provided something for you to start on. Just use the search feature of your pdf reader and search for cylinder. You can add color too if you want but that is up to you to discover. – hpesoj626 Dec 11 '12 at 15:46

For starters, you can do something like the one below.

\begin{tikzpicture}[>=latex,shorten >=2pt,shorten <=2pt,shape aspect=1]
\node (A) [cylinder, shape border rotate=90, draw,minimum height=3cm,minimum width=2cm]
\draw [<->] (A.before top) -- (A.after top) node [midway, above,fill=white] {$A_0$};

enter image description here

You can read the appropriate documentation in the pgf manual

You can also manually draw your cylinder like the one below.

\draw (0,0) ellipse (1.25 and 0.5);
\draw (-1.25,0) -- (-1.25,-3.5);
\draw (-1.25,-3.5) arc (180:360:1.25 and 0.5);
\draw [dashed] (-1.25,-3.5) arc (180:360:1.25 and -0.5);
\draw (1.25,-3.5) -- (1.25,0);  
\fill [gray,opacity=0.5] (-1.25,0) -- (-1.25,-3.5) arc (180:360:1.25 and 0.5) -- (1.25,0) arc (0:180:1.25 and -0.5);

enter image description here

  • What is the difference between shape border rotate=90 and rotate=90? Is there an argument to adjust how much of the top of the cylinder is displayed? – akozi Jun 15 at 14:42

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.