Repository: sympy/sympy

Issue:
plot_implicit lacks a line_color option
```
Unlike many of the other plotting functions in the new plotting module, plot_implicit lacks the ability to set the color of the line via a line_color function. 

Implementing the option should be very similar to implementing line_color in plot.
```
Original issue for #6688: http://code.google.com/p/sympy/issues/detail?id=3589
Original author: https://code.google.com/u/111207639578282893178/


Discussion:

Patch:
diff --git a/sympy/functions/special/gamma_functions.py b/sympy/functions/special/gamma_functions.py
index 6b839d6730..6532b69e24 100644
--- a/sympy/functions/special/gamma_functions.py
+++ b/sympy/functions/special/gamma_functions.py
@@ -162,9 +162,6 @@ def _eval_is_real(self):
     def _eval_rewrite_as_tractable(self, z):
         return C.exp(loggamma(z))
 
-    def _eval_rewrite_as_factorial(self, z):
-        return C.factorial(z - 1)
-
     def _eval_nseries(self, x, n, logx):
         x0 = self.args[0].limit(x, 0)
         if not (x0.is_Integer and x0 <= 0):
diff --git a/sympy/plotting/plot.py b/sympy/plotting/plot.py
index 3f9a1661d9..cb4f41ca45 100644
--- a/sympy/plotting/plot.py
+++ b/sympy/plotting/plot.py
@@ -922,13 +922,13 @@ def process_series(self):
                 if len(points) == 2:
                     #interval math plotting
                     x, y = _matplotlib_list(points[0])
-                    self.ax.fill(x, y, facecolor='b', edgecolor='None' )
+                    self.ax.fill(x, y, facecolor=s.line_color, edgecolor='None')
                 else:
                     # use contourf or contour depending on whether it is
                     # an inequality or equality.
                     #XXX: ``contour`` plots multiple lines. Should be fixed.
                     ListedColormap = self.matplotlib.colors.ListedColormap
-                    colormap = ListedColormap(["white", "blue"])
+                    colormap = ListedColormap(["white", s.line_color])
                     xarray, yarray, zarray, plot_type = points
                     if plot_type == 'contour':
                         self.ax.contour(xarray, yarray, zarray,
diff --git a/sympy/plotting/plot_implicit.py b/sympy/plotting/plot_implicit.py
index 5514c35210..0cd490ebd8 100644
--- a/sympy/plotting/plot_implicit.py
+++ b/sympy/plotting/plot_implicit.py
@@ -45,7 +45,8 @@ class ImplicitSeries(BaseSeries):
     is_implicit = True
 
     def __init__(self, expr, var_start_end_x, var_start_end_y,
-            has_equality, use_interval_math, depth, nb_of_points):
+            has_equality, use_interval_math, depth, nb_of_points,
+            line_color):
         super(ImplicitSeries, self).__init__()
         self.expr = sympify(expr)
         self.var_x = sympify(var_start_end_x[0])
@@ -60,6 +61,7 @@ def __init__(self, expr, var_start_end_x, var_start_end_y,
         self.nb_of_points = nb_of_points
         self.use_interval_math = use_interval_math
         self.depth = 4 + depth
+        self.line_color = line_color
 
     def __str__(self):
         return ('Implicit equation: %s for '
@@ -231,6 +233,11 @@ def plot_implicit(expr, x_var=None, y_var=None, **kwargs):
 
     - ``ylabel`` string. The label for the y-axis
 
+    Aesthetics options:
+
+    - ``line_color``: float or string. Specifies the color for the plot.
+        See ``Plot`` to see how to set color for the plots.
+
     plot_implicit, by default, uses interval arithmetic to plot functions. If
     the expression cannot be plotted using interval arithmetic, it defaults to
     a generating a contour using a mesh grid of fixed number of points. By
@@ -345,6 +352,7 @@ def _range_tuple(s):
     use_interval = kwargs.pop('adaptive', True)
     nb_of_points = kwargs.pop('points', 300)
     depth = kwargs.pop('depth', 0)
+    line_color = kwargs.pop('line_color', "blue")
     #Check whether the depth is greater than 4 or less than 0.
     if depth > 4:
         depth = 4
@@ -353,7 +361,7 @@ def _range_tuple(s):
 
     series_argument = ImplicitSeries(expr, var_start_end_x, var_start_end_y,
                                     has_equality, use_interval, depth,
-                                    nb_of_points)
+                                    nb_of_points, line_color)
     show = kwargs.pop('show', True)
 
     #set the x and y limits


Test patch:
diff --git a/sympy/functions/special/tests/test_gamma_functions.py b/sympy/functions/special/tests/test_gamma_functions.py
index a1f991a732..ddeb42baf9 100644
--- a/sympy/functions/special/tests/test_gamma_functions.py
+++ b/sympy/functions/special/tests/test_gamma_functions.py
@@ -70,10 +70,6 @@ def test_gamma():
     assert gamma(3*exp_polar(I*pi)/4).is_nonpositive is True
 
 
-def test_gamma_rewrite():
-    assert gamma(n).rewrite(factorial) == factorial(n - 1)
-
-
 def test_gamma_series():
     assert gamma(x + 1).series(x, 0, 3) == \
         1 - EulerGamma*x + x**2*(EulerGamma**2/2 + pi**2/12) + O(x**3)
diff --git a/sympy/plotting/tests/test_plot_implicit.py b/sympy/plotting/tests/test_plot_implicit.py
index 1eb6d88549..d90004c7a1 100644
--- a/sympy/plotting/tests/test_plot_implicit.py
+++ b/sympy/plotting/tests/test_plot_implicit.py
@@ -1,5 +1,5 @@
 import warnings
-from sympy import (plot_implicit, cos, Symbol, Eq, sin, re, And, Or, exp, I,
+from sympy import (plot_implicit, cos, Symbol, symbols, Eq, sin, re, And, Or, exp, I,
                    tan, pi)
 from sympy.plotting.plot import unset_show
 from tempfile import NamedTemporaryFile
@@ -57,9 +57,17 @@ def plot_and_save(name):
         assert issubclass(w[-1].category, UserWarning)
         assert 'No labeled objects found' in str(w[0].message)
 
+def test_line_color():
+    x, y = symbols('x, y')
+    p = plot_implicit(x**2 + y**2 - 1, line_color="green", show=False)
+    assert p._series[0].line_color == "green"
+    p = plot_implicit(x**2 + y**2 - 1, line_color='r', show=False)
+    assert p._series[0].line_color == "r"
+
 def test_matplotlib():
     matplotlib = import_module('matplotlib', min_module_version='1.1.0', catch=(RuntimeError,))
     if matplotlib:
         plot_and_save('test')
+        test_line_color()
     else:
         skip("Matplotlib not the default backend")