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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mintics now properly support lists #1870

Merged
merged 1 commit into from Mar 7, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions Packages/vcs/Lib/template.py
Expand Up @@ -1176,13 +1176,16 @@ def drawTicks(self, slab, gm, x, axis, number,
txs.append(wc[0])
tstring.append(loc[l])
# now does the mini ticks
if getattr(gm, axis + 'mtics' + number) != '':
mintics = getattr(gm, axis + 'mtics' + number)
if mintics != '':
if isinstance(mintics, str):
mintics = vcs.elements["list"][mintics]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chaosphere2112 can it ever be '*' ?

obj = getattr(self, axis + 'mintic' + number)
if obj.priority > 0:
ynum = getattr(self._data, "_y%s" % number)
xnum = getattr(self._data, "_x%s" % number)
for l in getattr(gm, axis + 'mtics' + number).keys():
a = getattr(gm, axis + 'mtics' + number)[l]
for l in mintics.keys():
a = mintics[l]
if axis == 'x':
if xmn <= l <= xmx:
if vcs.elements["projection"][
Expand Down
5 changes: 5 additions & 0 deletions testing/vcs/test_vcs_mintics.py
Expand Up @@ -13,9 +13,14 @@
# Should ignore the string here
box.xmtics1 = {i:"Test" for i in range(-180, 180, 15) if i % 30 != 0}
box.ymtics1 = {i:"Test" for i in range(-90, 90, 5) if i % 10 != 0}
box.xmtics2 = "lon15"
box.ymtics2 = "lat5"
template = x.createtemplate()
template.xmintic1.priority = 1
template.ymintic1.priority = 1
template.xmintic2.priority = 1
template.xmintic2.y2 += template.xmintic1.y1 - template.xmintic1.y2
template.ymintic2.priority = 1
x.plot(s, template, box, bg=1)
fnm = "test_vcs_mintics.png"
x.png(fnm)
Expand Down