Why my time series autoplot is not showing correctly?

I'm trying to use forecast autoplot for my time series plot. however my plot doesn't reflect correctly. Any suggestions?
code:
ocean_ts= ts(temp[,8],start=c(1850,1),end=c(2015,12),frequency=12)
autoplot(ocean_ts)

I want the plot to show year from 1850 however it is showing from year 1950. Values are present for year 1850 - 1950, still it is not reflecting in the plot.

It looks like you have missing values for the first 100 years. Please share the data if you want further help.

Hello Rob,

Thank you for replying, I was not able to attach the dataset, however please find the URL to the dataset.

I'm trying to do a timeseries plot for the LandandOcean Average Temp. When I rechecked the data, values are not missing for the first 100 years(between 1850 - 1950)

That doesn't help as we don't know what you've done to import the data into R. Please share the output of dput(ocean_ts) and head(temp, 12).

structure(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, 12.833, 13.588, 14.043, 14.667, 15.507, 16.353, 16.783,
16.718, 15.886, 14.831, 13.897, 13.3, 13.245, 13.331, 13.897,
14.64, 15.771, 16.496, 16.831, 16.621, 16.058, 15.213, 14.161,
13.638, 13.231, 13.311, 13.736, 14.786, 15.899, 16.619, 16.984,
16.566, 16.038, 15.178, 13.948, 13.782, 13.143, 13.362, 14.033,
14.919, 15.793, 16.455, 16.999, 16.789, 15.942, 14.874, 13.829,
13.324, 12.983, 13.248, 14.089, 14.945, 15.793, 16.286, 16.775,
16.707, 16.098, 15.378, 14.123, 13.467, 13.384, 13.646, 14.172,
15.187, 15.822, 16.445, 16.675, 16.685, 15.829, 15.075, 14.118,
13.215, 13.368, 13.311, 13.957, 14.945, 15.813, 16.492, 16.675,
16.39, 15.641, 14.783, 13.856, 13.321, 12.972, 13.385, 13.916,
14.481, 15.279, 16.175, 16.478, 16.459, 15.84, 14.918, 13.829,
13.367, 13.221, 13.29, 14.044, 14.967, 15.541, 16.172, 16.51,
16.489, 15.833, 15.114, 14.134, 13.263, 13.058, 13.33, 14.104,
15.197, 15.868, 16.4, 16.494, 16.45, 15.589, 15.062, 14.094,
13.513, 13.17, 13.424, 13.714, 14.861, 15.758, 16.338, 16.737,
16.634, 16.133, 15.076, 13.922, 12.828, 12.475, 12.917, 13.824,
15.018, 15.489, 16.358, 16.547, 16.716, 15.927, 14.905, 14.095,
13.337, 12.658, 13.192, 14.044, 14.825, 15.708, 16.349, 16.593,
16.306, 15.788, 14.902, 13.784, 12.732, 13.296, 13.634, 14.006,
15.01, 15.823, 16.224, 16.575, 16.437, 15.898, 14.978, 13.992,
13.356, 12.879, 13.275, 13.99, 14.83, 15.851, 16.49, 16.715,
16.494, 15.85, 14.972, 14.141, 13.271, 13.503, 13.506, 13.914,
14.861, 15.756, 16.414, 16.749, 16.657, 16.082, 15.157, 14.101,
13.26, 13.467, 13.586, 13.95, 14.713, 15.63, 16.596, 17.06, 16.695,
15.918, 15.062, 14.275, 13.732, 13.371, 13.458, 14.073, 15.1,
15.56, 16.366, 16.672, 16.454, 16.147, 15.318, 14.632, 13.553,
13.012, 13.295, 14.135, 15.082, 15.992, 16.529, 17.025, 16.793,
16.107, 15.376, 14.174, 13.643, 13.289, 13.951, 13.947, 15.016,
15.896, 16.396, 16.667, 16.711, 16.18, 15.171, 14.255, 13.307,
13.304, 13.359, 14.139, 15.052, 15.826, 16.511, 16.86, 16.617,
16.073, 15.056, 14.079, 13.176, 13.089, 13.299, 14.223, 15.233,
15.77, 16.458, 16.858, 16.653, 16.02, 15.061, 13.972, 13.435,
13.041, 13.376, 14.107, 14.969, 15.927, 16.361, 16.843, 16.822,
16.173, 15.181, 14.101, 13.331, 13.353, 13.707, 14.151, 14.879,
15.821, 16.429, 16.805, 16.726, 15.965, 15.13, 14.094, 13.531,
13.392, 13.458, 13.807, 14.91, 15.75, 16.211, 16.745, 16.645,
16.122, 15.005, 14.013, 13.426, 13.027, 13.35, 13.974, 14.923,
15.792, 16.358, 16.683, 16.638, 16.059, 15.125, 13.905, 13.229,
13.1, 13.496, 14.047, 14.95, 15.57, 16.29, 16.848, 16.579, 15.89,
15.047, 13.903, 13.193, 13.306, 13.732, 14.459, 15.126, 15.854,
16.594, 17.004, 17.076, 16.437, 15.536, 14.564, 13.704, 13.538,
14.177, 14.882, 15.573, 16.016, 16.711, 16.999, 16.905, 16.267,
15.307, 14.388, 13.526, 13.349, 13.63, 14.34, 14.987, 15.807,
16.501, 16.746, 16.635, 16.007, 15.25, 14.203, 13.318, 13.129,
13.407, 14.273, 15.008, 15.85, 16.4, 16.687, 16.695, 15.918,
15.024, 14.233, 13.48, 13.396, 13.625, 14.355, 15.267, 15.999,
16.329, 16.783, 16.665, 15.982, 15.115, 14.019, 13.511, 13.632,
13.843, 14.339, 15.031, 15.816, 16.356, 16.634, 16.678, 16.108,
15.022, 14.033, 13.187, 13.106, 13.358, 14.236, 14.916, 15.825,
16.512, 16.664, 16.538, 15.956, 15.054, 13.943, 13.451, 13.279,
13.6, 13.914, 14.744, 15.558, 16.185, 16.434, 16.408, 15.826,
14.954, 13.827, 13.27, 12.889, 13.327, 14.021, 14.747, 15.565,
16.105, 16.601, 16.438, 15.907, 15.054, 14.057, 13.542, 13.001,
13.176, 13.888, 14.841, 15.837, 16.197, 16.622, 16.458, 15.831,
14.979, 13.877, 13.316, 12.62, 13.096, 13.946, 14.941, 15.651,
16.214, 16.63, 16.372, 15.916, 14.983, 14.037, 13.386, 13.132,
13.32, 13.972, 14.938, 15.73, 16.36, 16.686, 16.611, 15.995,
15.318, 14.259, 13.608, 13.417, 13.954, 14.446, 15.305, 15.915,
16.498, 16.796, 16.604, 15.913, 15.116, 13.996, 13.401, 13.068,
13.394, 13.891, 14.875, 15.624, 16.25, 16.528, 16.427, 15.842,
15.02, 13.803, 13.367, 13.037, 13.298, 14.191, 14.918, 15.844,
16.297, 16.62, 16.549, 16.07, 15.023, 13.92, 13.559, 13.264,
13.667, 13.979, 14.804, 15.655, 16.303, 16.476, 16.39, 15.998,
15.126, 13.732, 13.196, 12.702, 13.23, 14.111, 14.871, 15.662,
16.382, 16.788, 16.65, 15.932, 15.152, 14.079, 13.388, 13.039,
13.455, 14.08, 14.794, 15.656, 16.226, 16.687, 16.565, 15.927,
15.165, 14.036, 13.347, 13.084, 13.303, 13.989, 15.005, 15.703,
16.352, 16.716, 16.612, 15.981, 15.151, 14.219, 13.513, 13.366,
13.576, 14.047, 14.895, 15.817, 16.515, 16.866, 16.762, 16.143,
15.27, 14.187, 13.643, 13.312, 13.555, 14.152, 15.217, 16.02,
16.505, 16.783, 16.676, 16.068, 15.168, 14.047, 13.401, 13.396,
13.364, 13.749, 14.868, 15.621, 16.393, 16.627, 16.512, 15.914,
14.915, 13.933, 13.351, 13.306, 13.399, 14.003, 15.026, 15.836,
16.243, 16.689, 16.746, 16.178, 15.287, 14.455, 13.412, 13.142,
13.777, 14.4, 15.17, 15.955, 16.515, 16.785, 16.699, 16.124,
15.373, 14.189, 13.598, 13.29, 13.66, 14.383, 15.22, 15.936,
16.441, 16.718, 16.663, 16.001, 15.087, 14.101, 13.38, 13.302,
13.691, 14.1, 14.958, 15.719, 16.284, 16.69, 16.591, 16.032,
14.991, 13.902, 13.24, 13.275, 13.668, 14.05, 14.801, 15.645,
16.161, 16.496, 16.304, 15.771, 14.835, 13.828, 13.205, 12.957,
13.154, 13.859, 14.755, 15.573, 16.207, 16.525, 16.403, 15.768,
14.947, 14.144, 13.433, 13.205, 13.206, 14.035, 14.857, 15.788,
16.379, 16.651, 16.558, 16.004, 15.091, 14.232, 13.45, 13.25,
13.502, 14.245, 15.23, 15.769, 16.436, 16.662, 16.593, 15.95,
15.152, 14.054, 13.54, 13.108, 13.257, 14.15, 14.918, 15.602,
16.253, 16.596, 16.456, 15.902, 15.159, 13.872, 13.225, 13.16,
13.441, 13.783, 14.801, 15.757, 16.289, 16.618, 16.365, 15.93,
14.883, 13.842, 13.189, 12.839, 13.35, 13.852, 14.719, 15.6,
16.191, 16.437, 16.496, 15.849, 14.941, 13.993, 13.217, 13.139,
13.317, 13.872, 14.845, 15.712, 16.264, 16.543, 16.477, 15.875,
15.019, 13.75, 13.016, 12.908, 13.164, 13.752, 14.716, 15.497,
16.108, 16.431, 16.387, 15.799, 15.063, 14.062, 13.425, 13.249,
13.595, 13.995, 15.065, 15.813, 16.397, 16.509, 16.309, 15.685,
14.751, 13.928, 13.23, 13.066, 13.344, 13.953, 14.957, 15.679,
16.216, 16.552, 16.496, 15.867, 15.028, 14.123, 13.624, 13.545,
13.576, 14.103, 15.018, 15.857, 16.421, 16.653, 16.692, 16.075,
15.223, 14.155, 13.597, 13.32, 13.675, 14.32, 15.292, 16.067,
16.445, 16.817, 16.802, 16.102, 15.093, 14.254, 13.538), tsp = c(1850,
2015.91666666667, 12), class = "ts")

head(temp, 12)

So your ocean_ts has initial missing values as I suggested.

You haven't provided the output of head(temp,12) (only a partial image of it), so it is not possible to see whether the initial values in the 8th column of temp were also missing. But it is clear that the dates for temp begin in 1750, not 1850 as you claimed.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.