Revert "Revert "visualization.R: attempted fix""

This reverts commit 5fb4d8454e5e67baf74f3d3572ca52ac0ac35b2b.