将整个动态范围还原到色图的子部分 [英] Restore full dynamic range to a subsection of a colormap

查看:53
本文介绍了将整个动态范围还原到色图的子部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在同一个图上同时散点图两个分布,以便我可以一目了然地看到每个分布以及它们之间的关系.

...因此,如果我从Viridis中取出一部分,从等离子中取出一部分(例如,使用如何在 matplotlib 中提取颜色图的子集作为新的颜色图?)我应该可以开始了.>

但是我失去了整个动态范围.

是否存在任何黑客"行为?恢复此动态范围?

完整的数学美学"解决方案可能是深入研究颜色图的生成代码并从头开始重新生成,但是我怀疑这是一次深入的研究.

解决方案

您如何期望获取颜色图的一个子集,但仍具有该颜色图的整个动态范围?这不是颜色图的工作原理.

解决此问题的一种方法是仅使用看起来完全不同的两个颜色图.我的 CMasher 包提供了大量的科学颜色图,它们都被设计为在感知上一致且唯一在外观上.您可以轻松地找到两个非常不同的颜色图.

I wish to simultaneously scatterplot two distributions on the same plot, so that I can see at a glance each distribution, as well as the relationship between them.

https://matplotlib.org/3.1.0/tutorials/colors/colormaps.html shows:

... so if I take a chunk out of Viridis and a chunk out of Plasma, (e.g. using how to extract a subset of a colormap as a new colormap in matplotlib?) I should be good to go.

But then I'm losing the full dynamic range.

Is there any "hack" to restore this dynamic range?

The full "mathematically aesthetic" solution may be to dig into the generating code for the colormaps and regenerate from scratch, but I suspect this is a deep dive.

解决方案

How do you expect to take a subset of a colormap but still have the full dynamic range of the colormap? That is not how colormaps work.

One way you can solve this is by simply using two colormaps that look vastly different. My CMasher package provides a large set of scientific colormaps, which were all designed to be perceptually uniform sequential and unique in appearance. You can easily find two colormaps that are very different there.

这篇关于将整个动态范围还原到色图的子部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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