0

Out of meterological data with 3 dimensions (lat, lon and time) I selected a subset and aggregated values of two different timespans/years into monthly means.

So at the end I have a DataSet where the dimension are the months (1-12) and there are two variables... Mean Values of timespan 1 and Mean Values of timespan 2.

Now I just want to plot these two variables on a simple Line chart to compare them. I already spent hours and days to find any advice on this, but it seems, that xarray isn't made for plotting multiple variables over each other? (Can't find anything useful for this)

2
  • So, you have one DataSet with two climatologies? And if you run data.clim1 or data.clim1 in the console, you see the the data sets and your climatologies are different? (Just to make sure, that you do not plot the same thing over each other.) You should be able to plot them with: import matplotlib.pyplot as plt plt.figure() data.clim1.plot() data.clim2.plot() If that does nor work, we might need more information on the problem. Commented Aug 17, 2020 at 15:51
  • forgot to call plt.figure() in advance (ooh-myy)...pls post your hint as answer so that I am able to accept it Commented Aug 18, 2020 at 11:10

1 Answer 1

1

So, you have one DataSet with two climatologies? And if you run data.clim1 or data.clim1 in the console, you see the the data sets and your climatologies are different? (Just to make sure, that you do not plot the same thing over each other.)

You should be able to plot them with:

import matplotlib.pyplot as plt
plt.figure()
data.clim1.plot()
data.clim2.plot()

Hope that works. :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.