Created gplot object in main() instead of plotting function