在相位角图中使用的没有视觉失真的循环色图? [英] Cyclic colormap without visual distortions for use in phase angle plots?

查看:87
本文介绍了在相位角图中使用的没有视觉失真的循环色图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个好的圆形/循环色图来表示相角信息(其中值限制在[0,2π]范围内,而0和2π表示相同的相角).

I'm looking for a good circular/cyclic colormap to represent phase angle information (where the values are restricted to the range [0, 2π] and where 0 and 2π represent the same phase angle).

背景:我想通过绘制功率谱密度和整个系统振荡的相对相位信息来可视化正常模式.

Background: I'd like to visualize normal modes by plotting both the power spectral density and the relative phase information of the oscillations across the system.

我会承认,以前我将'rainbow'颜色图用于功率图,将'hsv'颜色图用于相图(请参阅[1]).但是,由于彩虹色图缺乏感知的线性和有序性,因此极不建议使用彩虹色图[2] [3].因此,我切换到了"coolwarm"颜色图,以绘制我非常喜欢的功率图.不幸的是,"hsv"色图似乎引入了与彩虹"图相同的视觉失真(并且它与"coolwarm"图也不很吻合,因为相比之下看起来有些丑陋和浮华)

I'll admit that previously I used the 'rainbow' colormap for the power plot and the 'hsv' colormap for the phase plot (see [1]). However, the use of the rainbow colormap is extremely discouraged because of its lack of perceptual linearity and ordering [2][3]. So I switched to the 'coolwarm' colormap for the power plot which I quite like. Unfortunately, the 'hsv' colormap seems to introduce the same kind of visual distortions as the 'rainbow' map (and it also doesn't go along very well with the 'coolwarm' map since it looks kind of ugly and flashy in comparison).

有人对我可以用于相图的替代圆形颜色图有很好的建议吗?

Does anyone have a good recommendation for an alternative circular colormap which I could use for the phase plots?

要求:

  • 它必须是圆形的,以便值0和2π用相同的颜色表示.

  • It needs to be circular so that the values 0 and 2π are represented by the same color.

它不应引入任何视觉失真;特别是,它应该在感知上是线性的("hsv"颜色图似乎不是).我不认为对相位信息而言,感知排序是如此重要,但这当然不会造成任何危害.

It should not introduce any visual distortions; in particular, it should be perceptually linear (which the 'hsv' colormap doesn't seem to be). I don't believe that perceptual ordering is such a big deal for phase information, but it would of course not do any harm.

当与"coolwarm"颜色图结合使用时,它应该在视觉上具有吸引力.但是,我对"coolwarm"还不满意,如果有另一对漂亮的色彩图可以可视化幅度和相位信息,我很乐意考虑其他选择.

It should be visually appealing when combined with the 'coolwarm' colormap. However, I'm not dead set on 'coolwarm' and am happy to consider other options if there is another nice pair of colormaps to visualize amplitude and phase information.

奖金表示颜色图是否可用(或可以轻松创建)用于matplotlib.

Bonus points if the colormap is available (or can be easily created) for use in matplotlib.

非常感谢您的任何建议!

Many thanks for any suggestions!

[1] http://matplotlib.org/examples/color/colormaps_reference.html

[2] http://www.renci.org/~borland/pdfs/RainbowColorMap_VisViewpoints.pdf

[3] http://medvis .org/2012/08/21/rainbow-colormaps-what-are-they-for-absolutely-nothing/

推荐答案

您可以尝试"husl"系统,类似于hls/hsv,但具有更好的视觉属性.它可以在 seaborn

You could try the "husl" system, which is similar to hls/hsv but with better visual properties. It is available in seaborn and as a standalone package.

这是一个简单的例子:

import numpy as np
from numpy import sin, cos, pi
import matplotlib.pyplot as plt
import seaborn as sns

n = 314
theta = np.linspace(0, 2 * pi, n)

x = cos(theta)
y = sin(theta)

f = plt.figure(figsize=(10, 5))
with sns.color_palette("husl", n):
    ax = f.add_subplot(121)
    ax.plot([np.zeros_like(x), x], [np.zeros_like(y), y], lw=3)
    ax.set_axis_off()
    ax.set_title("HUSL space")

with sns.color_palette("hls", n):
    ax = f.add_subplot(122)
    ax.plot([np.zeros_like(x), x], [np.zeros_like(y), y], lw=3)
    ax.set_axis_off()
    ax.set_title("HLS space")

f.tight_layout()

这篇关于在相位角图中使用的没有视觉失真的循环色图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆