def get_positions(region_sizes, as_dict=False):
    """Get linearly spaced positions for plotting region nodes."""
    x = []
    y = []
    for i, r_s in enumerate(region_sizes):
        for j in range(r_s):
            x.append(i)
            y.append(j)
    if as_dict:
        my_dict = {}
        for i, (x_val, y_val) in enumerate(zip(x, y)):
            my_dict[i] = (x_val, y_val)
        return my_dict
    return x, y