The reason why fig cannot be created is due to the bug in ghostscript 9.22.
I found a solution (temporarily) in ubuntu 18.04. The steps are:
- Download the ghostscript 9.23 here
- Untar it at, say, /foo/.
- sudo mv /usr/bin/gs /usr/bin/gs_orig_922
- sudo ln -sf /download/Ghostscript/ghostscript-9.23-linux-x86_64/gs-923-linux-x86_64 /usr/bin/gs
- Done!