Added square style node joining to the plotting function