Open karlmsmith opened 6 years ago
Would be nice to have control on gratucule color indeed.
yes? shade/graticule=(dash, color=(70,70,70), opacity=0.3) var
Or add a lightgray and a gray in default colors ready to be used.
It would be nice if the current restriction is explicitly documented in the official manual. We've recently had this question: https://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2019/msg01105.html in the mailing list.
Yes, this should be documented. I also think it would be less confusing if this were handled as an ERROR instead of a warning. The warning messages (NOTE's) can easily be lost in the Ferret output, and because this syntax is not allowed it should be an error.
Note that PyFerret does allow both a custom color and an opacity in the syntax "PPL COLOR" so in the example in the description above we could have
yes? ppl color 7,100,20,50
yes? PLOT/COLOR=(60,50,20)/GRATICULE="(DASH,COLOR=7)" I[I=1:50]
! or
! Define a gray color with, 50% opacity
yes? ppl color 7,50,50,50,50
yes? PLOT/COLOR=(60,50,20)/GRATICULE="(DASH,COLOR=7)" I[I=1:50]
The original issue here was resolved in 2022, so that colors for graticule lines can be completely customized.
The extra color definitions needed to customize horizontal and vertical graticule lines are added in set_graticules.F. The opacity can be set using the 4-argument color specifier /graticule=(color=(r,g,b,a)) - though I don't know how useful that will be.
Examples are added in the demo script graticules_demo.jnl (as of today in the fork ACManke).
Also, it would be good if the documentation were changed; it would need to be done for all of the plot commands, CONTOUR, PLOT, VECTOR, SHADE, and POLYGON.
e.g. under the CONTOUR command currently it says,
The syntax is
yes? CONTOUR/GRATICULE[=line or dash,COLOR=,THICKNESS=] var
where the default is a thin, solid black line. The line colors available are Black, Red, Green, Blue, LightBlue, Purple, and White.
The thickness codes are 1, 2, or 3 and as for plot lines, thickness=1 is a thin line, thickness=3 is the thickest, and THICK
specified with no value defaults to thickness=2. For clarity the arguments to GRAT may be placed in parentheses
yes? CONTOUR/GRAT sst ! default graticules
yes? CONTOUR/GRAT=(LINE,COLOR=red,THICK=3) sst
yes? CONTOUR/GRAT=(DASH,COLOR=lightblue) sst
yes? CONTOUR/FILL/GRAT=(DASH,COLOR=white) sst
This could be changed to say,
The syntax is
yes? CONTOUR/GRATICULE[=line or dash,COLOR=,THICKNESS=] var
where the default is a thin, solid black line. The line colors available are Black, Red, Green, Blue, LightBlue, Purple, and White.
The line color may alternatively be given with an (r,g,b,a) specification as is the case for line plots and contour lines. The
thickness codes are 1, 2, or 3 and as for plot lines, thickness=1 is a thin line, thickness=3 is the thickest, and THICK specified
with no value defaults to thickness=2. For clarity the arguments to GRAT may be placed in parentheses
yes? CONTOUR/GRAT sst ! default graticules
yes? CONTOUR/GRAT=(LINE,COLOR=red,THICK=3) sst
yes? CONTOUR/GRAT=(DASH,COLOR=lightblue) sst
yes? CONTOUR/FILL/GRAT=(DASH,COLOR=white) sst
yes? CONTOUR/FILL/GRAT=(thick=3,COLOR=(60,60,60)) sst
The opacity can be set using . . . - though I don't know how useful that will be.
If adding graticules is possible in overlays, then opacity would be useful. I sometimes want to plot graticules over an existing shading. For example, I would plot a shading of an oceanic variable, add latitude and longitude lines, and then overlay another variable in contour lines. I'd like those latitude and longitude lines to be half transparent.
After fixing issue #50 to properly parse custom colors in the /GRAT= optino, ends up custom colors are not supported for graticules. At this time a warning message is issued and black is used instead.
and the plot actually is a red (ie, incorrect color) line with black graticules.
gives the correct colors for the line and the graticules. The following also works correctly:
which was given as a suggested work-around on the email list.