Latex Transition Problem    
   I have been getting this error UnboundLocalError: local variable 'xmin' referenced before assignment and I have been wondering why the error is present. And how I could fix it to get the LaTex for it.
Sage: from sage.graphs.graph_plot import GraphPlot
Sage: options = {
....:   'vertex_size': 200,
....:   'vertex_labels': True,
....:   'layout': None,
....:   'edge_style': 'solid',
....:   'edge_color': 'black',
....:   'edge_colors': None,
....:   'edge_labels': False,
....:   'iterations': 50,
....:   'tree_orientation': 'down',
....:   'heights': None,
....:   'graph_border': False,
....:   'talk': False,
....:   'color_by_label': False,
....:   'partition': None,
....:   'dist': .075,
....:   'max_dist': 1.5,
....:   'loop_size': .075,
....:   'edge_labels_background': 'transparent'}
Sage:xmin = -10 
     xmax = 10
     f = plot((x^2-2)/(x+2), (x,xmin, xmax), ymin = -20, ymax = 20)
     pt1 = point((-2,2), rgbcolor='blue', pointsize=40)
     z = Graph((f+pt1).show(xmin= xmin, xmax= xmax, ymin=-20, ymax=20))
     GP = GraphPlot(z, options)
Sage:z.set_latex_options(
....: graphic_size=(5,5),
....: vertex_size=0.2,
....: edge_thickness=0.04,
....: edge_color='green',
....: vertex_color='green',
....: vertex_label_color='red'
....: )
Sage: latex(z)
 
  
 
GraphPlotis for plotting the mathematical "graph" object – see https://en.wikipedia.org/wiki/Graph_t..., for example. It is not for plotting graphs of functions. I don't believe that there is a way in Sage to get LaTeX output for producing the graph of a function like (x^2-2)/(x+2). The LaTeX package TikZ/PGF can do that, but that's independent of Sage.