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

Wrong overlay when use polygon/modulo with specific levels #1937

Closed
PBrockmann opened this issue May 27, 2019 · 1 comment
Closed

Wrong overlay when use polygon/modulo with specific levels #1937

PBrockmann opened this issue May 27, 2019 · 1 comment

Comments

@PBrockmann
Copy link

PBrockmann commented May 27, 2019

When you use polygon/modulo with /lev and specific levels, an overlay plot is drawn with wrong colors and wrong levels.

image

use etopo60

!=======================================
let var = rose
let yvar = ysequence(var)

!=======================================
! Create bounds of cells
let lon_LL =  ysequence(var*0+xboxlo[g=var])
let lon_UL =  ysequence(var*0+xboxlo[g=var])
let lon_UR =  ysequence(var*0+xboxhi[g=var])
let lon_LR =  ysequence(var*0+xboxhi[g=var])
let lon_bounds0 = xcat(lon_LL,lon_UL)
let lon_bounds1 = xcat(lon_bounds0,lon_UR)
let lon_bounds  = xcat(lon_bounds1,lon_LR)
let/units=degrees_east/title=LONGITUDE ylon = lon_bounds

!=======================================
! Create bounds of cells
let lat_LL =  ysequence(var*0+yboxlo[g=var])
let lat_UL =  ysequence(var*0+yboxhi[g=var])
let lat_UR =  ysequence(var*0+yboxhi[g=var])
let lat_LR =  ysequence(var*0+yboxlo[g=var])
let lat_bounds0 = xcat(lat_LL,lat_UL)
let lat_bounds1 = xcat(lat_bounds0,lat_UR)
let lat_bounds  = xcat(lat_bounds1,lat_LR)
let/units=degrees_north/title=LATITUDE ylat = lat_bounds

!=======================================
polygon/modulo/hlim=-10:60/vlim=30:60/line/fill/pal=default/lev=25 ylon, ylat, yvar
go land
pause

!=======================================
! overlay with bad palette and levels !!
polygon/modulo/hlim=-10:60/vlim=30:60/line/fill/pal=topo/lev=(0,100,10)(100,1000,100)(1000,6000,1000) ylon, ylat, yvar
go land

Note also that you need to set /units=degrees_east and /units=degrees_north to get Longitude and Latitude axis but then you get an extra unuseful name(units) for axis labels.

image

rather than

image

Last point that would be nice to improve is the fact that once the plot is drawn there is a redraw that is done. It particularly slow with a 1° resolution grid and could be suppressed.

Tested with last 7.44 and 7.50 releases.

@AnsleyManke
Copy link
Contributor

This is fixed in xeq_polygon.F The code does this as if it's two commands; a polygon plot and a polygon/overlay, with the modulo operation on the longitudes. The setting to re-use the color levels was incorrect, also the setting to not draw the colorbar on the overlay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants