docs: def plot_zij(fignum, datablock, angle, s, norm=True):
      """
      function to make Zijderveld diagrams
  
      Parameters
      __________
      fignum : matplotlib figure number
      datablock : nested list of [step, dec, inc, M (Am2), type, quality]
                  where type is a string, either 'ZI' or 'IZ' for IZZI experiments
      angle : desired rotation in the horizontal plane (0 puts X on X axis)
      s : specimen name
      norm : if True, normalize to initial magnetization = unity
  
      Effects
      _______
      makes a zijderveld plot
  
      """
      global globals
      plt.figure(num=fignum)
      plt.clf()
      if not isServer:
          plt.figtext(.02, .01, version_num)
      amin, amax = 0., -100.
      if norm == 0:
          fact = 1.
      else:
          fact = (1./datablock[0][3])   # normalize to NRM=1
      # convert datablock to DataFrame data with  dec,inc, int
      data = pd.DataFrame(datablock)
      if len(data.columns) == 5:
          data.columns = ['treat', 'dec', 'inc', 'int', 'quality']
      if len(data.columns) == 6:
          data.columns = ['treat', 'dec', 'inc', 'int', 'type', 'quality']
      elif len(data.columns) == 7:
          data.columns = ['treat', 'dec', 'inc', 'int', 'type', 'quality', 'y']
      #print (len(data.columns))
      data['int'] = data['int']*fact  # normalize
      data['dec'] = (data['dec']-angle) % 360  # adjust X axis angle
      gdata = data[data['quality'].str.contains('g')]
      bdata = data[data['quality'].str.contains('b')]
      forVDS = gdata[['dec', 'inc', 'int']].values
      gXYZ = pd.DataFrame(pmag.dir2cart(forVDS))
      gXYZ.columns = ['X', 'Y', 'Z']
      amax = np.maximum(gXYZ.X.max(), gXYZ.Z.max())
      amin = np.minimum(gXYZ.X.min(), gXYZ.Z.min())
      if amin > 0:
          amin = 0
      bXYZ = pmag.dir2cart(bdata[['dec', 'inc', 'int']].values).transpose()
  # plotting stuff
      if angle != 0:
          tempstr = "\n Declination rotated by: " + str(angle) + '\n'
      if globals != 0:
          globals.text.insert(globals.END, tempstr)
          globals.Zlist = gXYZ['x'].tolist()
          globals.Zlisty = gXYZ['y'].tolist()
          globals.Zlistz = gXYZ['z'].tolist()
      if len(bXYZ) > 0:
          plt.scatter(bXYZ[0], bXYZ[1], marker='d', c='y', s=30)
          plt.scatter(bXYZ[0], bXYZ[2], marker='d', c='y', s=30)
      plt.plot(gXYZ['X'], gXYZ['Y'], 'ro')
      plt.plot(gXYZ['X'], gXYZ['Z'], 'ws', markeredgecolor='blue')
      plt.plot(gXYZ['X'], gXYZ['Y'], 'r-')
      plt.plot(gXYZ['X'], gXYZ['Z'], 'b-')
      for k in range(len(gXYZ)):
          plt.annotate(str(k), (gXYZ['X'][k], gXYZ['Z']
                                [k]), ha='left', va='bottom')
      if amin > 0 and amax >0:amin=0 # complete the line
      if amin < 0 and amax <0:amax=0 # complete the line
      xline = [amin, amax]
     # yline=[-amax,-amin]
      yline = [amax, amin]
      zline = [0, 0]
      plt.plot(xline, zline, 'k-')
      plt.plot(zline, xline, 'k-')
      if angle != 0:
          xlab = "X: rotated to Dec = " + '%7.1f' % (angle)
      if angle == 0:
          xlab = "X: rotated to Dec = " + '%7.1f' % (angle)
      plt.xlabel(xlab)
      plt.ylabel("Circles: Y; Squares: Z")
      tstring = s + ': NRM = ' + '%9.2e' % (datablock[0][3])
      plt.axis([amin, amax, amax, amin])
      plt.axis("equal")
      plt.title(tstring)