from boomslang.LineStyle import LineStyle

class Grid(object):
    def __init__(self, color="#dddddd", style="-", visible=True):
        self.color = color
        self._lineStyle = LineStyle()
        self._lineStyle.style = style
        self.visible = visible

    @property
    def style(self):
        return self._lineStyle.style

    @style.setter
    def style(self, value):
        self._lineStyle.style = value

    @style.getter
    def style(self):
        return self._lineStyle.style

    def draw(self, fig, axes):
        if self.visible:
            axes.grid(color=self.color, linestyle=self.style)
            # Gridlines should be below plots
            axes.set_axisbelow(True)

from boomslang.LineStyle import LineStyle

class Grid(object):
    def __init__(self, color="#dddddd", style="-", visible=True):
        self.color = color
        self._lineStyle = LineStyle()
        self._lineStyle.style = style
        self.visible = visible
        self.which = 'major'

    @property
    def style(self):
        return self._lineStyle.style

    @style.setter
    def style(self, value):
        self._lineStyle.style = value

    @style.getter
    def style(self):
        return self._lineStyle.style

    def draw(self, fig, axes):
        if self.visible:
            axes.grid(color=self.color, linestyle=self.style,
                      which=self.which)
            # Gridlines should be below plots
            axes.set_axisbelow(True)

Allow gridlines on both major and minor axes.
Allow gridlines on both major and minor axes.

  from boomslang.LineStyle import LineStyle
  
  class Grid(object):
      def __init__(self, color="#dddddd", style="-", visible=True):
          self.color = color
          self._lineStyle = LineStyle()
          self._lineStyle.style = style
          self.visible = visible
+         self.which = 'major'
  
      @property
      def style(self):
          return self._lineStyle.style
  
      @style.setter
      def style(self, value):
          self._lineStyle.style = value
  
      @style.getter
      def style(self):
          return self._lineStyle.style
  
      def draw(self, fig, axes):
          if self.visible:
-             axes.grid(color=self.color, linestyle=self.style)
+             axes.grid(color=self.color, linestyle=self.style,
+                       which=self.which)
              # Gridlines should be below plots
              axes.set_axisbelow(True)
  
Allow gridlines on both major and minor axes.
## Code Before:
from boomslang.LineStyle import LineStyle

class Grid(object):
    def __init__(self, color="#dddddd", style="-", visible=True):
        self.color = color
        self._lineStyle = LineStyle()
        self._lineStyle.style = style
        self.visible = visible

    @property
    def style(self):
        return self._lineStyle.style

    @style.setter
    def style(self, value):
        self._lineStyle.style = value

    @style.getter
    def style(self):
        return self._lineStyle.style

    def draw(self, fig, axes):
        if self.visible:
            axes.grid(color=self.color, linestyle=self.style)
            # Gridlines should be below plots
            axes.set_axisbelow(True)

## Instruction:
Allow gridlines on both major and minor axes.
## Code After:
from boomslang.LineStyle import LineStyle

class Grid(object):
    def __init__(self, color="#dddddd", style="-", visible=True):
        self.color = color
        self._lineStyle = LineStyle()
        self._lineStyle.style = style
        self.visible = visible
        self.which = 'major'

    @property
    def style(self):
        return self._lineStyle.style

    @style.setter
    def style(self, value):
        self._lineStyle.style = value

    @style.getter
    def style(self):
        return self._lineStyle.style

    def draw(self, fig, axes):
        if self.visible:
            axes.grid(color=self.color, linestyle=self.style,
                      which=self.which)
            # Gridlines should be below plots
            axes.set_axisbelow(True)
