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

Fixed bug that was breaking continents when set at canvas level #1794

Merged
merged 3 commits into from
Jan 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Packages/vcs/Lib/Canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ def _reconstruct_tv(self, arglist, keyargs):
if contout is None:
if (xdim >= 0 and ydim >= 0 and tv.getAxis(xdim).isLongitude()
and tv.getAxis(ydim).isLatitude()) or (self.isplottinggridded):
contout = 1
contout = self.getcontinentstype()
else:
contout = 0

Expand Down Expand Up @@ -977,6 +977,7 @@ def __init__(self, gui=0, mode=1, pause_time=0,

self.configurator = None
self.setcontinentsline("default")
self.setcontinentstype(1)

# Initial.attributes is being called in main.c, so it is not needed here!
# Actually it is for taylordiagram graphic methods....
Expand Down
8 changes: 7 additions & 1 deletion testing/vcs/test_continents.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,20 @@

line_styles = ['long-dash', 'dot', 'dash', 'dash-dot', 'solid']


for i in range(12):
cont_index = i % 6 + 1
cont_line = vcs.createline()
cont_line.width = i % 3 + 1
cont_line.type = line_styles[i % 5]
cont_line.color = i + 200
template = multitemplate.get(i)
canvas.plot(clt, template, boxfill, continents=cont_index, continents_line=cont_line, bg=1)
if cont_index != 3:
canvas.plot(clt, template, boxfill, continents=cont_index, continents_line=cont_line, bg=1)
else:
canvas.setcontinentsline(cont_line)
canvas.setcontinentstype(3)
canvas.plot(clt, template, boxfill, bg=1)

# Load the image testing module:
testingDir = os.path.join(os.path.dirname(__file__), "..")
Expand Down