3

I've been reading this tutorial on wikibooks.

They've shown a way to create the disks:

\setlength{\unitlength}{1mm}
\begin{picture}(60, 40)
\put(15,10){\circle*{1}}
\put(20,10){\circle*{2}}
\put(25,10){\circle*{3}}
\put(30,10){\circle*{4}}
\put(35,10){\circle*{5}}
\end{picture}

But... I am unable to put the diamater greater than 5.

What is the problem? Am I doing something wrong?

\setlength{\unitlength}{1mm}
\begin{picture}(60, 40)
\put(15,10){\circle*{1}}
\put(20,10){\circle*{2}}
\put(25,10){\circle*{3}}
\put(30,10){\circle*{4}}
\put(35,10){\circle*{5}}
\put(40,10){\circle*{6}}
\put(45,10){\circle*{7}}
\put(50,10){\circle*{8}}
\put(55,10){\circle*{9}}
\put(60,10){\circle*{10}}
\end{picture}

enter image description here

3
  • 4
    The standard LaTeX picture environment cannot draw disks (filled circles) with a diameter greater than 40 pt (about 0.2 inches or about 5 mm). This is because, in reality, all it's doing is selecting the closest match from a specialised font which just contains picture objects. The pict2e package provides substantial improvements (including a much larger range of possible disk sizes (possibly unlimited, I don't know)) by using the capabilities of device-drivers. There are better ways even that this to draw pictures these days, though. e.g. TikZ
    – Au101
    Commented Oct 24, 2015 at 19:53
  • @Au101, thank you. I was just curious about the picture environment in this case. Commented Oct 24, 2015 at 19:56
  • 1
    I had the same question: "Why on earth can't \circle draw a circle with an arbitrary radius/diameter?" — and indeed all I needed to do was add the single line \usepackage{pict2e} to make all my circles look much better. Thanks! Commented Dec 6, 2022 at 18:25

1 Answer 1

5

As already mentioned by Au101 in his comment, the restrictions of standard LaTeX picture environment have been rectified by pict2e package. All you have to do is add the line \usepackage{pict2e} in the preamble.

\documentclass{article}
\usepackage{pict2e}
\begin{document}
  \setlength{\unitlength}{1mm}
\begin{picture}(60, 40)
\put(15,10){\circle*{1}}
\put(20,10){\circle*{2}}
\put(25,10){\circle*{3}}
\put(30,10){\circle*{4}}
\put(35,10){\circle*{5}}
\put(40,10){\circle*{6}}
\put(45,10){\circle*{7}}
\put(50,10){\circle*{8}}
\put(55,10){\circle*{9}}
\put(60,10){\circle*{20}}
\end{picture}
\end{document}

enter image description here

But this is a new era where we have more sophisticated tools like tikz, pstricks, metapost asymptote etc. Here is a sample of tikz. These methods are highly flexible and can be very colourful.

\documentclass{article}
\usepackage{tikz}
\begin{document}
  \begin{tikzpicture}[x=1mm,y=1mm]
    \foreach \x in {0,1,...,50}{
    \fill[olive!\x!red!10] (\x,0) circle (0.1*\x);
    }
  \end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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