Repository: ManimCommunity/manim
Pull request: Fix #101
Fixes #101 

The issue was that the lines of `NumberPlane` were automatically centred on the axis, which could cause problem when `x_max `was not equal to `x_min`. (same for y).
Example of the issue : 
```python
class Test(Scene):
    def construct(self):
        NPac=NumberPlane(x_max=20).add_coordinates()
        NPac.scale(0.3)
        NPac.center()
        self.add(NPac)
```
Render this : 
![Test](https://user-images.githubusercontent.com/36239975/85371972-6e7e0900-b531-11ea-8392-e1e322fcca4a.png)
As you can see, x-paralleles lines are shifted to the left. 
Now, this is fixed : 
![Test](https://user-images.githubusercontent.com/36239975/85373824-20b6d000-b534-11ea-9a19-ef10f34042c7.png)

![Test](https://user-images.githubusercontent.com/36239975/85373674-e5b49c80-b533-11ea-9d12-eb6920552043.png)

I tested it with tests set up by #133 (not merged yet) and locally. 

I also added a little bit of docstrings.

Problem statement:
Bug in NumberPlane when using x_max (and likely the y/min values too)
```python
NPac=NumberPlane(x_max=20).add_coordinates()
class Test(Scene):
    def construct(self):
        self.add(NPac.shift([-15,0,0]))
        self.wait(1)
```
This results in the horizontal lines not being anywhere near as long as they should be. Leaving this here for either someone else to investigate or fix, or in case of doubt myself coming back to this some point in the not too close future.

Hints from issue discussion:

Commit message: fixed minor bug (small shift of the grid)

Patch to review:
diff --git a/manim/mobject/coordinate_systems.py b/manim/mobject/coordinate_systems.py
index 10b2e2dca8..845d0d9845 100644
--- a/manim/mobject/coordinate_systems.py
+++ b/manim/mobject/coordinate_systems.py
@@ -288,6 +288,7 @@ def __init__(self, **kwargs):
         self.init_background_lines()
 
     def init_background_lines(self):
+        """Will init all the lines of NumberPlanes (faded or not)"""
         if self.faded_line_style is None:
             style = dict(self.background_line_style)
             # For anything numerical, like stroke_width
@@ -310,6 +311,16 @@ def init_background_lines(self):
         )
 
     def get_lines(self):
+        """Generate all the lines, faded and not faded. Two sets of lines are generated, parallel to the X-axis and to Y-axis.
+        
+        Returns
+        -------
+        :class:`~.VGroup`
+            First set of lines (i.e the non faded lines)
+
+        :class:`~.VGroup`
+            Second set of lines (i.e the faded lines)
+        """
         x_axis = self.get_x_axis()
         y_axis = self.get_y_axis()
         x_freq = self.x_line_frequency
@@ -327,21 +338,39 @@ def get_lines(self):
         lines2 = VGroup(*x_lines2, *y_lines2)
         return lines1, lines2
 
-    def get_lines_parallel_to_axis(self, axis1, axis2, freq, ratio):
-        line = Line(axis1.get_start(), axis1.get_end())
+    def get_lines_parallel_to_axis(self, axis_parallel_to, axis_perpendicular_to, freq, ratio):
+        """Generated a set of lines parallel to an axis.
+
+        Parameters
+        ----------
+        axis_parallel_to : :class:`~.Line`
+            The axis with which the lines will be parallel.
+
+        axis_perpendicular_to : :class:`~.Line`
+            The axis with which the lines will be perpendicular. 
+
+        Returns
+        -------
+        lines1 : :class:`~.VGroup`
+            First set of lines (i.e the non faded lines parallel to 'axis_parallel_to')
+
+        lines2 : :class:`~.VGroup`
+            Second set of lines (i.e the faded lines parallel to 'axis_parallel_to')            
+        """
+        line = Line(axis_parallel_to.get_start(), axis_parallel_to.get_end())
         dense_freq = (1 + ratio)
         step = (1 / dense_freq) * freq
-
         lines1 = VGroup()
         lines2 = VGroup()
+        unit_vector_axis_perp_to = axis_perpendicular_to.get_unit_vector()
         ranges = (
-            np.arange(0, axis2.x_max, step),
-            np.arange(0, axis2.x_min, -step),
+            np.arange(0, axis_perpendicular_to.x_max, step),
+            np.arange(0, axis_perpendicular_to.x_min, -step),
         )
         for inputs in ranges:
             for k, x in enumerate(inputs):
                 new_line = line.copy()
-                new_line.move_to(axis2.number_to_point(x))
+                new_line.shift(unit_vector_axis_perp_to * x)
                 if k % (1 + ratio) == 0:
                     lines1.add(new_line)
                 else:


Code review comments:
diff_hunk: @@ -310,6 +311,16 @@ def init_background_lines(self):
         )
 
     def get_lines(self):
+        """Generate all the lines, faded and not faded. Two sets of lines are generated, parallel to the X-axis and to Y-axis.
+        
+        Returns
+        -------
+        :class:`~.VGroup`
+            First set of lines (i.e the non faded lines)
+
+        :class:`~.VGroup`
+            Second set of lines (i.e the faded lines)
path: manim/mobject/coordinate_systems.py
text: @user1:
A function may only have one return type. Note that the `a, b` syntax is syntactic sugar for `(a, b)` (returns a tuple).
```suggestion
        Tuple[:class:`~.VGroup`, :class:`~.VGroup`]
            The first (i.e the non faded lines) and second (i.e the faded lines) sets of lines, respectively.
```

diff_hunk: @@ -327,21 +338,39 @@ def get_lines(self):
         lines2 = VGroup(*x_lines2, *y_lines2)
         return lines1, lines2
 
-    def get_lines_parallel_to_axis(self, axis1, axis2, freq, ratio):
-        line = Line(axis1.get_start(), axis1.get_end())
+    def get_lines_parallel_to_axis(self, axis_parallel_to, axis_perpendicular_to, freq, ratio):
+        """Generated a set of lines parallel to an axis.
+
+        Parameters
+        ----------
+        axis_parallel_to : :class:`~.Line`
+            The axis with which the lines will be parallel.
+
+        axis_perpendicular_to : :class:`~.Line`
+            The axis with which the lines will be perpendicular. 
+
+        Returns
+        -------
+        lines1 : :class:`~.VGroup`
+            First set of lines (i.e the non faded lines parallel to 'axis_parallel_to')
+
+        lines2 : :class:`~.VGroup`
+            Second set of lines (i.e the faded lines parallel to 'axis_parallel_to')            
path: manim/mobject/coordinate_systems.py
text: @user1:
Only one return value, and no names
Note that the usage of \` \` produces `this` on the sphinx docs result, so you might want to use that when referring to variables or parameters
```suggestion
        Tuple[:class:`~.VGroup`, :class:`~.VGroup`]
            The first (i.e the non faded lines parallel to `axis_parallel_to`) and second (i.e the faded lines parallel to `axis_parallel_to`) sets of lines, respectively.     
```

diff_hunk: @@ -327,21 +338,39 @@ def get_lines(self):
         lines2 = VGroup(*x_lines2, *y_lines2)
         return lines1, lines2
 
-    def get_lines_parallel_to_axis(self, axis1, axis2, freq, ratio):
-        line = Line(axis1.get_start(), axis1.get_end())
+    def get_lines_parallel_to_axis(self, axis_parallel_to, axis_perpendicular_to, freq, ratio):
+        """Generated a set of lines parallel to an axis.
path: manim/mobject/coordinate_systems.py
text: @user1:
```suggestion
        """Generate a set of lines parallel to an axis.
```