@Override
	protected void run() throws Exception {
		PluginTool tool = getState().getTool();
		GraphDisplayBroker service = tool.getService(GraphDisplayBroker.class);
		GraphDisplay display = service.getDefaultGraphDisplay(false, monitor);
		generateGraph();
		display.setGraph(graph, "Test", false, monitor);
	}
Sample script to test graph service
Ghidra/Features/Base/developer_scripts/GenerateTestGraphScript.java