4
$\begingroup$

How can I place GridLines above the colored region of a ChromaticityPlot (and hence make them visible throughout the plot) without resorting to Mesh or drawing explicit lines? This example shows the default is to place the GridLines behind the colored area, and is hence unacceptable:

ChromaticityPlot["RGB", {"CIE31", .96},
 GridLines -> {Range[0, .8, .1], Range[0, .8, .1]},
 GridLinesStyle -> Directive[Orange]]
$\endgroup$

1 Answer 1

7
$\begingroup$
ChromaticityPlot["RGB", {"CIE31", .96}, 
 GridLines -> {Range[0, .8, .1], Range[0, .8, .1]}, 
 GridLinesStyle -> Directive[Orange], 
 Method -> {"GridLinesInFront" -> True},
 PlotRangeClipping -> False]

enter image description here

Note: This and other previously undocumented Method suboptions are now documented in Graphics > Options > Method:

enter image description here

Note also that, as is true for all *Plot and *Chart functions, many Graphics options accepted by a plot/chart function are not listed in the options section of the function's reference page. This is mentioned under the Options and Details sections.

enter image description here

$\endgroup$
3
  • $\begingroup$ Oh my... GridLinesInFront... who would have thought! (It should be added to the WRI documentation for ChromaticityPlot.) Thanks so much. ($+1, \checkmark$). $\endgroup$ May 9, 2023 at 18:14
  • 1
    $\begingroup$ FYI GridLinesInFront is mentionned here $\endgroup$
    – andre314
    May 9, 2023 at 18:20
  • 2
    $\begingroup$ This is now documented in Graphics >> Options >> Method. $\endgroup$
    – kglr
    May 9, 2023 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.