original_string: public function addHorizontalLine($y, $color = 'red', $label = '')
      {
  
          if (!array_key_exists($color, $this->ink)) {
              throw(new \Exception("Ink color must be in " . implode(",",
                      \array_keys($this->ink))));
          }
  
          $y = $this->plotValue($y);
          imageline($this->im, 0, $y, $this->width, $y, $this->ink[$color]);
  
          imagestring($this->im, 2, $this->graph_width / 2 + $this->axis_offset,
              $y, $label, $this->ink[$color]);
      }
code: public function addHorizontalLine($y, $color = 'red', $label = '')
      {
  
          if (!array_key_exists($color, $this->ink)) {
              throw(new \Exception("Ink color must be in " . implode(",",
                      \array_keys($this->ink))));
          }
  
          $y = $this->plotValue($y);
          imageline($this->im, 0, $y, $this->width, $y, $this->ink[$color]);
  
          imagestring($this->im, 2, $this->graph_width / 2 + $this->axis_offset,
              $y, $label, $this->ink[$color]);
      }
code_tokens: public function addHorizontalLine ( $ y , $ color = 'red' , $ label = '' ) { if ( ! array_key_exists ( $ color , $ this -> ink ) ) { throw ( new \ Exception ( "Ink color must be in " . implode ( "," , \ array_keys ( $ this -> ink ) ) ) ) ; } $ y = $ this -> plotValue ( $ y ) ; imageline ( $ this -> im , 0 , $ y , $ this -> width , $ y , $ this -> ink [ $ color ] ) ; imagestring ( $ this -> im , 2 , $ this -> graph_width / 2 + $ this -> axis_offset , $ y , $ label , $ this -> ink [ $ color ] ) ; }
docstring: Add a horizontal line
  
  @param integer $y The y value
  @param string $color red, orange, yellow, green, blue, purple
  @param string $label The line label
docstring_tokens: Add a horizontal line