0

I have two graphs: one is the list of each day in 2018 (datetime object) on x-axis with its corresponding value on y-axis, the other one is the list of each week in 2018( 52 in total) on x-axis with its corresponding average value on y-axis.

I was asked to merge two plots on the same graph. However, if I set both domains to be days in 2018, the latter graph goes wrong and following shows up

ValueError: x and y must have same first dimension, but have shapes (365,) and (52,)

What should I do to get the things sorted out? Many thanks in advance.

Alexis
  • 1
  • 2
  • maybe: https://stackoverflow.com/questions/26690480/matplotlib-valueerror-x-and-y-must-have-same-first-dimension – FuzzyAmi Feb 17 '19 at 12:13
  • I have tried that and the same error shows up – Alexis Feb 17 '19 at 16:15
  • Can you provide your code and some example data? Accroding to your description, maybe the x-data of your latter graph is coverted to shape of (365,) whereas the y-data maintains the shape of (52,). – C.K. Feb 18 '19 at 14:46
  • That is exactly where the problem lies. But I just need to plot it with these data. – Alexis Feb 22 '19 at 00:41

0 Answers0