9 Practical 2

9.1 Copy cat

This data set consists of seven observations on cotton aphid counts on twenty randomly chosen leaves in each plot, for twenty-seven treatment-block combinations. The data were recorded in July 2004 in Lamesa, Texas. The treatments consisted of three nitrogen levels (blanket, variable and none), three irrigation levels (low, medium and high) and three blocks, each being a distinct area. Irrigation treatments were randomly assigned within each block as whole plots. Nitrogen treatments were randomly assigned within each whole block as split plots.

See if you can recreate the plot below. Some hints

  • You can convert a numeric varibles to a categorical one with .astype('category')
  • The category_orders argument can be used to specify the order of the facets
  • The easiest way to get lines and points is to create a scatter plot first, then use update_traces(mode='lines+markers')