3

enter image description here

I dno't know how to draw arrows as the above figure, and the code I wrote for the four points don't even show up on a result. Why my points don't appear? And what should be added for the arrows?

\documentclass{article}       
 \usepackage{tikz}     
 \begin{document}   
  \begin{tikzpicture}      
  \draw [fill=black](0, 0) circle;   
  \draw [fill=black](1, 0) circle;   
  \draw [fill=black](1, -1) circle;   
  \draw [fill=black](0, -1) circle;   
  \end{document}   

\documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \end{document}

  • The circles don't show up because their radius is zero. You do know that tikz comes with a very extensive manual full of tutorials and such? – John Kormylo May 25 '16 at 12:29
  • @JohnKormylo I just learned a few from YouTube and a pdf file and from this website. Can you give a link for that tutorial? – buzzee May 25 '16 at 12:35
  • Go to texdoc.net and search for tikz, chances are you already have the manual on your pc – daleif May 25 '16 at 13:05
5
\documentclass{article}       
\usepackage{tikz}     
\begin{document}   
\begin{tikzpicture}
\node[circle, draw=black, fill=black, name=0] at (0,0) {};
\node[xshift=-2mm] at (0.west) {0};

\node[circle, draw=black, fill=black, name=1] at (0,1) {};
\node[xshift=-2mm] at (1.west) {1};

\node[circle, draw=black, fill=black, name=3] at (1,0) {};
\node[xshift=2mm] at (3.east) {3};

\node[circle, minimum width=1pt, draw=black, fill=black, name=2] at (1,1) {};
\node[xshift=2mm] at (2.east) {2};


\draw[->, blue] (0) -- (2);
\draw[->, blue] (0) -- (3);
\draw[->, blue] (0) -- (1);
\draw[->, blue] (1) -- (2);
\draw[->, blue] (1) -- (3);
\draw[->, blue] (2) -- (3);

\end{tikzpicture}
\end{document}

enter image description here

  • For smaller dots, inner sep=0pt,minimum size=4pt. Adjust 4pt to ones liking. – Torbjørn T. May 25 '16 at 16:50
1

A PSTricks solution:

\documentclass{article}

\usepackage{pst-node}

% parameters
\def\width{3}
\def\height{2}

% size of bounding box
\pstFPadd\Width{\width}{0.27}
\pstFPadd\Height{\height}{0.34}

\begin{document}

\begin{pspicture}(-0.27,-0.34)(\Width,\Height)
  \pnodes{P}(0,\height)(\width,\height)(\width,0)(0,0)
  \psdots(P0)(P1)(P2)(P3)
  \psset{arrows = ->, linecolor = cyan!80, nodesep = 1.5pt}
  \uput[135](P0){$0$}
  \uput[45](P1){$1$}
  \uput[315](P2){$2$}
  \uput[225](P3){$3$}
  \ncline{P0}{P1}
  \ncline{P1}{P2}
  \ncline{P2}{P3}
  \ncline{P0}{P3}
  \ncline{P0}{P2}
  \ncline{P1}{P3}
\end{pspicture}

\end{document}

output

All you have to do is change the values of the parameters and the drawing will by adjusted accordingly.

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.