-
Notifications
You must be signed in to change notification settings - Fork 5
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
Customizable squashing function #3
Comments
At first I thought: Why map the interval at all? Real-valued plots simply take the min and max values of the function on the plotted domain and identify those values with the lower and upper end of the color map. We could do the same for abs(z). Done. Then I realized that that identifying 0 with black and infinity with white has one very nice propery: Complex angles don't have meaning for 0 and infinity just like hue doesn't have meaning for black and white. This is a correspondence we should not simply let go. So yeah, let's map. :) I'm not sure if I agree to make the map configurable though. Introducing one fixed map will make all plots made with complex_colormap comparable. If the map is configurable, users may be tempted to "highlight" certain aspects of their data, effectively distorting it and making the plot misleading.
set
|
Probably redundant, but I thought I'd mention this diagram which I often come back to for this sort of mapping (although most of the time I just end up using
The formula in @nschloe's comment above kind of matches the last one in the diagram, |
One nice property of
is that
This makes sure that when comparing inverses, e.g., |
That's what I do, though. 😅 |
Mapping [0, ∞) to [0, 1] can be done many different ways, and I found some worked better or worse for different functions.
I originally used
mpmath.cplot
for this, which combines squashing and colormapping into the same functiondefault_color_function()
, but maybe more logical to separate them? Like specify mapping and colormap as parameters tocplot
, like matplotlib'snorm
parameter.The text was updated successfully, but these errors were encountered: