private void buildAndDisplayGraph(TaskMonitor monitor)
			throws GraphException, CancelledException {

		GraphType graphType = new PCodeDfgGraphType();
		Function func = hfunction.getFunction();
		graph = new AttributedGraph("Data Flow Graph", graphType);
		buildGraph();

		GraphDisplay graphDisplay = graphService.getDefaultGraphDisplay(false, monitor);
		GraphDisplayOptions displayOptions = new PCodeDfgDisplayOptions(tool);

		String description = "AST Data Flow Graph For " + func.getName();
		graphDisplay.setGraph(graph, displayOptions, description, false, monitor);

		// Install a handler so the selection/location will map
		graphDisplay.setGraphDisplayListener(new PCodeDfgDisplayListener(tool, graphDisplay,
			hfunction, func.getProgram()));
	}
Task for creating PCode data flow graphs from decompiler output
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/PCodeDfgGraphTask.java