Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taylor Diagram with EzTemplate #272

Closed
lee1043 opened this issue Nov 14, 2017 · 2 comments
Closed

Taylor Diagram with EzTemplate #272

lee1043 opened this issue Nov 14, 2017 · 2 comments
Assignees
Labels

Comments

@lee1043
Copy link
Contributor

lee1043 commented Nov 14, 2017

When plotting Taylor Diagram in EzTemplate, TD does not have proper border lines.

import vcs
import MV2
import EzTemplate

# Create dummy 7 data
corr = [.2, .5, .7, .85, .9, .95, .99]
std = [1.6, 1.7, 1.5, 1.2 , .8, .9, .98]
data = MV2.array(zip(std, corr))
data.id = "My Taylor Diagram Data"

print 'data:\n', data
print 'data shape:', data.shape

# Set up canvas and template
canvas = vcs.init()
my_template = vcs.createtemplate()
M = EzTemplate.Multi(template=my_template, rows=2,columns=2, x=canvas)
taylor = vcs.createtaylordiagram()

# Loop for sub panels
for i in range(4):
  if i==0:
    r=0
    c=0
  elif i==1:
    r=0
    c=1
  elif i==2:
    r=1
    c=0
  else:
    r=1
    c=1

  t = M.get(legend='local',row = r, column = c)
  taylor.referencevalue = 1.
  canvas.plot(data, t, taylor, skill=taylor.defaultSkillFunction)

# Save image
canvas.png('test.png')

test

Boundary lines are showing as rectangular rather than it supposed to be. The taylor.referencevalue = 1. is not working neither.

@doutriaux1
Copy link
Contributor

@lee1043 I think the taylor diagrams need a special template in order to work, (it's using some special atrributes of the template), try to start with

my_template = vcs.createtemplate(source="deftaylor")

@lee1043
Copy link
Contributor Author

lee1043 commented Nov 14, 2017

Awesome, works as expected! Thanks @doutriaux1

test

@lee1043 lee1043 closed this as completed Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants