<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose edge set is [(1, 2), (1, 3), (2, 3)], how can you use NetworkX to generate a LaTeX file that visualizes the graph with a spring layout and a scaling factor of 2?
### Response:
import networkx as nx

# Create a simple graph
G = nx.Graph()
G.add_edges_from([(1, 2), (1, 3), (2, 3)])

# Generate the latex code to draw the graph and write to a file
nx.drawing.nx_pylab.write_latex(G, path="my_graph.tex", options={'pos': nx.spring_layout(G), 'tikz_options': '[scale=2]'})
<|EOT|>
