-
Notifications
You must be signed in to change notification settings - Fork 361
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
Realigning order of basemap frame, gridlines, and annotations/ticks for all modules #4274
Conversation
Now, annotations are always at end but gridlines may happen before plotting of data.
Starge messing with -R -J inside makes it difficult to do later
I got only 133 failures in total. |
That is a new one - less failures on Windows than macOS (186 right now). |
Ex16 is partially eating the frame |
Yes, I need to fix the setting for grdview. It draws before but shoud be after (unless 3-D etc). |
|
|
But that was always the case. We do -B in the first command and then pile on. This needs moving the -B to the last call. |
I think we have many tests where we plot numerous overlays and often start with -Baf. To follow our plan I think these need to move to the last command. Finally, we do not yet have a solution for subplots since it will add -B settings to the first command in the panel, not last. Changing this is harder and will be pursued after this PR. |
Apologies for fixing #4181 in this PR but I wanted to be safe it did not break other things. The double frame is now gone. |
Yes, we saw it before and we thought it may be a Preview bug. |
I have two more failing tests than you, but there are just tiny differences:
|
So OK with me updating the orig PS in this PR then? |
Yes to me. |
Hi @seisman ane @joa-quim, I think we have reached the end of the line on this PR. This clearly improved the quality of the plots. The one thing remaining is related to subplot panels where the -B happens on the first panel but perhaps should always be last. That will require more work since we cannot know we are last until we either move to a new frame or we are done. That is a separate PR. |
|
Yes, just an occasional network connection issue. |
Same number of failures (16). Some, |
I just made a commit 784347f to trigger full tests in CI. Will know if all tests pass in CI in 2 hours. |
OK, soon after finishing another PR. |
So clipping5.sh is flagged as GMT_KNOWN_FAILURE. I think it is not improved or degraded by this PR though; its solution lies elsewhere. |
OK, I didn't notice that. The CI looks good. One failure on Linux and 7 failures on Windows. They are all known failures. |
I just disabled the full tests in e529b14. Now this PR looks good to me. |
Description of proposed changes
See #4265 for contest. We want to add consistency to how GMT places the "basemap" on top of or below a plot within the same module (obviously, stacking modules can override any default arrangements). In general, we now place the optional gridlines before plotting data, but include images and polygons (e.g., via pscoast) in which case gridlines goes on top. We generally lay down the frame on top to ensure any lines or symbols at or near the boundary do not "eat" into the frame width, but if the module has a no-clip option like -N then we draw it first so symbols can straddle that line. Annotations and tick-marks are usually laid down before the plot but in the case of MAP_FRAME_TYPE=inside then we must do it at the end instead. There are also some exceptions for true 3-D plots.
Implementation is done via a new function gmt_set_basemap_orders which sets, for each of the discussed items, what the order of plotting should be. For instance, in pscoast it may say
gmt_set_basemap_orders (GMT, clipping ? GMT_BASEMAP_FRAME_BEFORE : GMT_BASEMAP_FRAME_AFTER, GMT_BASEMAP_GRID_AFTER, GMT_BASEMAP_ANNOT_AFTER);
where clipping options may require the frame to be drawn first instead of last, but otherwise we draw items later. Each plot module has such a call and the arguments vary. The function itself can override the settings based on some of the conditions discussed above.
After implementation, we now have ~180+ "failures" in the tests. Most of them are of these types:
Some plots that had gridlines on top now has gridlines on the bottom, avoiding cutting through symbols and bars
Some plots with polygons or bars near a border (e.g., histograms) now have a clean frame line without notches
Many base frames have subtle changes because tick marks are not plotted and are visible whereas in some cases they were covered up.
I have labeled this PR WIP because I think we need to actually look at all these to see if anything got lost in the translation that we want to preserve.