Reworking graph.py - one single function can now handle both axis