A function called through a card must have only one parameter.
import matplotlib.pyplot as plt def myfun(args): data, ax = args ax.plot(*data) fig = plt.figure() ax1 = fig.add_subplot(121) ax2 = fig.add_subplot(122) para = [ [[[1,2,3],[1,2,3]],ax1], [[[1,2,3],[3,2,1]],ax2], ] map(myfun, para) plt.show()
If you want to keep your function signature, use itertools.starmap .
import itertools import matplotlib.pyplot as plt def myfun(data, ax): ax.plot(*data) fig = plt.figure() ax1 = fig.add_subplot(121) ax2 = fig.add_subplot(122) para = [ [[[1,2,3],[1,2,3]],ax1], [[[1,2,3],[3,2,1]],ax2], ] list(itertools.starmap(myfun, para))