Improve the dhires plotting routine
Refactor dhires graphics plotting to C