Skip to content

FacetGrid map_dataarray usage? #7310

Discussion options

You must be logged in to vote

Hi Tom, hope you're well!
I realise now I was making a basic error, and misinterpreting the keyword arguments. For posterity:

da=xr.DataArray(data=np.random.randn(2,2,2,10,10),coords={'A':['a1','a2'],'B':[0,1],'C':[0,1],'X':range(10),'Y':range(10)})

#Plot the data on a FacetGrid, column 'B' against row 'C', with contours over 'X' and 'Y'
p=da.sel(A='a1').plot.contour(col='B',row='C') 
try:
    p.map_dataarray(xr.plot.pcolormesh, y="B", x="C") 
except:
    print("keywords 'y' and 'x' are not equivalent to 'col' and 'row'!!")
p.map_dataarray(xr.plot.pcolormesh, y="Y", x="X") 

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by joshdorrington
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants