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

Non-cyclic contour hue #2626

Open
jschueller opened this issue Apr 26, 2024 · 2 comments
Open

Non-cyclic contour hue #2626

jschueller opened this issue Apr 26, 2024 · 2 comments

Comments

@jschueller
Copy link
Member

jschueller commented Apr 26, 2024

What happened?

An idea mentioned by Regis to improve readability of contour plots was to avoid purple colors

contour2
contour1

But this clashes with #2587

How to reproduce the issue?

diff --git a/lib/src/Base/Func/EvaluationImplementation.cxx b/lib/src/Base/Func/EvaluationImplementation.cxx
index a56d7f823..5d6437c9b 100644
--- a/lib/src/Base/Func/EvaluationImplementation.cxx
+++ b/lib/src/Base/Func/EvaluationImplementation.cxx
@@ -447,7 +447,7 @@ Graph EvaluationImplementation::draw(const UnsignedInteger firstInputMarginal,
     current.setLabels(Description(1, labels[i]));
     current.setDrawLabels(false);
     current.setLegend(labels[i]);
-    current.setColor(Contour::ConvertFromHSV((360.0 * i / levels.getDimension()), 1.0, 1.0));
+    current.setColor(Contour::ConvertFromHSV((270.0 * i / levels.getDimension()), 1.0, 1.0));
     graph.add(current);
   }
   return graph;
diff --git a/lib/src/Base/Stat/CovarianceModelImplementation.cxx b/lib/src/Base/Stat/CovarianceModelImplementation.cxx
index 96f26e59c..f153e4c8f 100644
--- a/lib/src/Base/Stat/CovarianceModelImplementation.cxx
+++ b/lib/src/Base/Stat/CovarianceModelImplementation.cxx
@@ -1277,7 +1277,7 @@ Graph CovarianceModelImplementation::draw(const UnsignedInteger rowIndex,
     current.setLabels(Description(1, labels[i]));
     current.setDrawLabels(false);
     current.setLegend(labels[i]);
-    current.setColor(Contour::ConvertFromHSV((360.0 * i / levels.getDimension()), 1.0, 1.0));
+    current.setColor(Contour::ConvertFromHSV((270.0 * i / levels.getDimension()), 1.0, 1.0));
     graph.add(current);
   }
   return graph;
@regislebrun
Copy link
Member

@jschueller In the HSV color space the hue is divided into 6 sectors bounded by the primary and complementary colors. The idea I had was to remove the last sector, so 360.0 should be replaced by 300.0 and not 270.0.
I checked it on the NormalGamma PDF and it looks good to me. The last color is violet, quite far away from red

Figure_1

@josephmure
Copy link
Collaborator

josephmure commented Apr 30, 2024

Imo this issue is fixed by #2587 because it allows the user to select different (usually better) color maps than HSV.

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

No branches or pull requests

3 participants