weighting and plotting