Hi,
thanks to Juan for the Rpy package suggestion
I came up with this, which at least produces the plot. I can't quite work
out R specific bits at the moment (e.g. legend), but perhaps it might help
someone else.
#!/usr/bin/env python
import sys
from rpy2.robjects.packages import importr
import rpy2.robjects as robjects
r = robjects.r
# Note depends on R package plotrix
r.png(filename="x.png" ,width=480, height=480)
# fake some reference data
s = importr('stats')
ref = s.rnorm(30, sd=2)
ref_sd = r.sd(ref)
# add a little noise
model1 = s.rnorm(30, sd=2)
# add more noise
model2 = s.rnorm(30, sd=6)
# display the diagram with the better model
p = importr('plotrix')
#print plot
p.taylor_diagram(ref,model1)
# now add the worse model
p.taylor_diagram(ref,model2, add=True, col="blue")
# get approximate legend position
lpos = 1.5 * ref_sd[0]
# add a legend
#r.legend(lpos,lpos,legend=("Better","Worse"),pch=19,col=("red","blue"))
# now restore par values
#p.par(oldpar)
# show the "all correlation" display
p.taylor_diagram(ref,model1,pos_cor=False)
p.taylor_diagram(ref,model2,add=True,col="blue")
Martin
···
--
View this message in context: http://old.nabble.com/Taylor-diagram-tp30421393p30441744.html
Sent from the matplotlib - users mailing list archive at Nabble.com.