This answer How do we fill half rectangle in TikZ, shows how rectangles can be half-filled using the .south west
and .east
attributes of the path picture bounding box
.
I would like to know how this generalizes to filling a rectangle up to a certain percentage of its total height.
I want to control the height of the color fill by using only the number corresponding to the relative height I'd like to fill (e.g., 22 %, 58 %). I do not want to achieve this relative fill height by manually figuring out the coordinates.