What are you trying to plot? The variable years presumably is just a list of the years between 1931 and 1971. You have a variable measles with is a matrix of dimension 41 x 12. The number of rows, I would think, corresponds to each year, but what are the 12 columns? And what is the relationship between measles1931 and measles?
ETA: My guess is that the columns correspond to months. Okay, do you want to plot the data for a given month (say, September) vs year or a yearly average vs year? Or something else?
So, is measles1931 the number of cases for each month of 1931? If so, then you want to plot measles1931 versus month -- i.e., plot(1:12, measles1931), where the x axis would be the number of the month and the y axis would the number of cases in that month. You don't want to include the variable years, as you did in your example.
Thanks. I changed it and it has a graph side by side but it is says warning: ignoring legend entries. On the graph January is only coming up. How can I fix it?
1
u/Drezkul Sep 07 '22
What am I missing? Do I need to change .1000? I am trying to make a side by side graph.