-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG #1740: plotting with bg=0 produces labels off
This also fixes BUG #78 in cdat-web. For both bugs, VTKPlots.configureEvent is not called to reposition the labels.
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python | ||
import cdms2 | ||
import os | ||
import sys | ||
import vcs | ||
|
||
# Test that the image is created properly when we call plot with bg = 0 and | ||
# then we save a png. If the default png size is bigger than the screen size, | ||
# the image was not resized properly | ||
|
||
pth = os.path.join(os.path.dirname(__file__), "..") | ||
sys.path.append(pth) | ||
import checkimage | ||
|
||
cdmsfile = cdms2.open(os.path.join(vcs.sample_data, 'clt.nc')) | ||
clt = cdmsfile('clt') | ||
clt = clt(latitude=(-90.0, 90.0),squeeze=1,longitude=(-180.0, 175.0),time=('1979-01', '1988-12'),) | ||
|
||
x = vcs.init() | ||
x.setantialiasing(0) | ||
x.drawlogooff() | ||
|
||
gmIsofill = vcs.getisofill('a_robinson_isofill') | ||
args = [] | ||
args.append(clt) | ||
gmIsofill.datawc_calendar = 135441 | ||
gmIsofill.datawc_timeunits = 'days since 2000' | ||
gmIsofill.projection = 'robinson' | ||
kwargs = {} | ||
kwargs[ 'cdmsfile' ] = cdmsfile.id | ||
#kwargs[ 'bg' ] = 1 | ||
args.append( gmIsofill ) | ||
x.plot( *args, **kwargs) | ||
fileName = os.path.basename(__file__) | ||
fileName = os.path.splitext(fileName)[0] | ||
fileName = fileName + '.png' | ||
x.png(fileName) | ||
ret = checkimage.check_result_image(fileName, sys.argv[1], checkimage.defaultThreshold) | ||
sys.exit(ret) |