Add some scaling based on figure size

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>
Change keyword handling

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>
Add a docstring

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>