generalized some plotting