modification in dynamicplot according to theta