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

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

问题描述

我正在寻找一个好的圆形/循环颜色图来表示相位角信息(其中值限制在 [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-good-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天全站免登陆