Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Latex Transistion 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)
click to hide/show revision 2
None

Latex Transistion 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)