[Tex/LaTex] Removing part of a symbol or image


Tidying up and posing a secondary question which was answered

I'm trying to put together a visual aid of people numbers in a particular area, so I imagine using something like. Answered elsewhere using the marvosym package with \Gentsroom as the symbol.

Man image

Is there an easy way to shade out half the image e.g. If I'm using each figure to represent four people and I want to indicate 2 by using half a figure?

Link to earlier question below
Question on human shape in tikz

Note: The title is terrible but all I can think of. Please feel free to edit it.

Best Answer

(This answer was migrated from the original question)

If I understood correctly the question, the following code may help to devise an appropiate solution:

\path[clip] (0,0) rectangle (#1,1.1);
\foreach \i in {0,...,\pgfmathresult} {
\node[inner sep=0pt, above right] at (\i, 0) 


Macro \rowofmen{x} produces a row of x men, allowing for fractional values of x (the trick is to draw one more man and clipping the resulting figure). Superimposing several of these rows with different colors and lenghts (as in the \rlap example), you can simulate half-shaded men. This is the output:


Note that each man was resized to 2mm x 3mm. You can alter this by changing the parameters x=2mm,y=3mm of the tikzpicture and those of \resizebox. The remaining can be left unchanged.