<｜begin▁of▁sentence｜>### Instruction:
Given a path graph with 4 nodes, how can you write the graph to a GEXF file with visualization data for node 0 using NetworkX?
### Response:
import networkx as nx

# Create a path graph with 4 nodes
G = nx.path_graph(4)

# Adding visualization data to node 0
G.nodes[0]['viz'] = {'size': 54}
G.nodes[0]['viz']['position'] = {'x': 0, 'y': 1}
G.nodes[0]['viz']['color'] = {'r': 0, 'g': 0, 'b': 256}

# Write the graph to a GEXF file
nx.write_gexf(G, 'test.gexf', prettyprint=True, version='1.2draft')
<|EOT|>
