def nospines(left=False, bottom=False, top=True, right=True, **kwargs):
  """
  Hides the specified axis spines (by default, right and top spines)
  """

  ax = kwargs['ax']

  # assemble args into dict
  disabled = dict(left=left, right=right, top=top, bottom=bottom)

  # disable spines
  for key in disabled:
    if disabled[key]:
      ax.spines[key].set_color('none')

  # disable xticks
  if disabled['top'] and disabled['bottom']:
    ax.set_xticks([])
  elif disabled['top']:
    ax.xaxis.set_ticks_position('bottom')
  elif disabled['bottom']:
    ax.xaxis.set_ticks_position('top')

  # disable yticks
  if disabled['left'] and disabled['right']:
    ax.set_yticks([])
  elif disabled['left']:
    ax.yaxis.set_ticks_position('right')
  elif disabled['right']:
    ax.yaxis.set_ticks_position('left')

  return ax