def _maketicks(self, ax, ylabel='Energy (eV)'):
        """Utility method to add tick marks to a band structure."""
        # set y-ticks
        ax.yaxis.set_major_locator(MaxNLocator(6))
        ax.yaxis.set_minor_locator(AutoMinorLocator(2))

        # set x-ticks; only plot the unique tick labels
        ticks = self.get_ticks()
        unique_d = []
        unique_l = []
        if ticks['distance']:
            temp_ticks = list(zip(ticks['distance'], ticks['label']))
            unique_d.append(temp_ticks[0][0])
            unique_l.append(temp_ticks[0][1])
            for i in range(1, len(temp_ticks)):
                # Hide labels marked with @
                if '@' in temp_ticks[i][1]:
                    # If a branch connection, check all parts of label
                    if r'$\mid$' in temp_ticks[i][1]:
                        label_components = temp_ticks[i][1].split(r'$\mid$')
                        good_labels = [l for l in label_components
                                       if l[0] != '@']
                        if len(good_labels) == 0:
                            continue
                        else:
                            temp_ticks[i] = (temp_ticks[i][0],
                                             r'$\mid$'.join(good_labels))
                    # If a single label, check first character
                    elif temp_ticks[i][1][0] == '@':
                        continue

                # Append label to sequence if it is not same as predecessor
                if unique_l[-1] != temp_ticks[i][1]:
                    unique_d.append(temp_ticks[i][0])
                    unique_l.append(temp_ticks[i][1])

        logging.info('Label positions:')
        for dist, label in list(zip(unique_d, unique_l)):
            logging.info('\t{:.4f}: {}'.format(dist, label))

        ax.set_xticks(unique_d)
        ax.set_xticklabels(unique_l)
        ax.xaxis.grid(True, ls='-')
        ax.set_ylabel(ylabel)

        trans_xdata_yaxes = blended_transform_factory(ax.transData,
                                                      ax.transAxes)
        ax.vlines(unique_d, 0, 1,
                  transform=trans_xdata_yaxes,
                  colors=rcParams['grid.color'],
                  linewidth=rcParams['grid.linewidth'],
                  zorder=3)
Utility method to add tick marks to a band structure.