
from matplotlib import pyplot as plt

class vec(object):
    def __init__(self, x1, y1):
        """ ... """
        self.x1 = x1
        self.y1 = y1

    def get_line_xy(self):
        """ get x- and y-values of the line illustrating the vector """
        return [0.0, self.x1], [0.0, self.y1]

    def plot(self, ax, *args, **kwargs):
        """ plot the vector to a given axes 'ax' (matplotlib Axes instance)
        
            arguments and keyword arguments are passed to the plot method
            of the axes
        """
        ax.plot(*(self.get_line_xy()+args), **kwargs)


v1 = vec(1, 2)

x, y = v1.get_line_xy()
plt.plot(x, y, lw=10)
# or using the plot-function of the vector
v1.plot(plt.gca(), lw=3)
plt.show()
