问题标签 [colorbar]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
matlab - MATLAB:在包含 RGB 图像的图中显示灰度图像的颜色条
假设我们有两个图像:
1)RGB图像:
2)灰度图像:
让我们展示他们两个:
正如我们所看到的,第二个图中的颜色条(即灰度图像)完全有意义。另一方面,我无法真正理解第一张图中颜色图给出的信息。
我想实现的是在RGB图像对应的图中显示灰度图像的颜色条。
看起来这似乎没有意义,但这只是一个非常小的例子,我只是为了展示我想在一个更大的项目中做什么。
有什么想法吗?
非常感谢 :)
EDIT1:请允许我解释为什么我需要这个
假设我计算某些感兴趣区域的 MRI 切片中的一些生理参数,得到如下结果:
现在我想将这些参数叠加在原始切片之上,并创建一个 RGB 图像来实现这一点:
colormap没有意义,这就是为什么我想在RGB图像(即叠加图像)中显示与参数图像对应的colormap。
有任何想法吗?
感谢您的关注。
python - Matplotlib plots (pcolormesh and colorbar) shift with respect to their axes when using rasterized=True
I use matplotlib pcolormesh
plots with colorbars, apply rasterization to the plots and colorbars in order to reduce the file size and save the figure as a PDF file. Thereby I noticed, that after rasterization the color-area itself shifts a bit with respect to the axes towards up and left, so that a white stripe at the lower and right edge of the plot appears. Same happens to the colorbar, which I found even worse: with thin colorbars, the white stripe is very obvious and disturbing. Is there a way to avoid this behaviour of rasterized plots and to keep the rasterized area at the same place as before rasterization?
I tried to play around with rasterization_zorder
and zorder settings
. It helped a bit with the pcolormesh
plots (the lower white stripe disappeared), but I found no way to apply it to the colorbar
.
Down there is a simple example with four plots demonstrating the problem. Please zoom in into the PDF file at the lower right edges of the plots to see what I mean.
Any suggestions will be appreciated!
matlab - 如何将标记添加到matlab颜色条?
我想通过我的 matlab 颜色栏中的特定值添加一个 tarker/特殊刻度线。例如,假设我有一个从 -20 到 60 的颜色条比例,我的临界值为 37.53,我如何通过颜色条的该值添加标记?
matplotlib - 如何将 matplotlib 颜色条刻度线更改为朝外?
我在 matplotlib 示例库中注意到,他们所有具有垂直颜色条的图都有朝内的刻度线,
(即从条的边缘进入条的彩色区域)。
对于我正在使用的绘图类型和色标,最好让刻度线朝外。
我将如何修改 matplotlib 库(见下文)中的这个简单示例,使其颜色条上有朝外的刻度线?
matplotlib - 颜色条缩小散点图
希望是一个简单的修复.. 我的图像右侧绘制了一个颜色条。这样做会将我的散点图缩小到左侧;但是,我希望散布点尽可能接近 1:1,因为 x 轴和 y 轴的比例相同。
python - 制作包含负值的对数比例彩色图
我在 matplotlib 中有一个表面密度图,我希望颜色条的比例为对数。
理想情况下,使用该LogNorm
函数应该可以解决问题,但是有负值和空值,当值变为对数时会产生错误。
在这方面,我是否可以使用函数/方法来包含具有负值和空值的区域?
matplotlib - 在不更改实际绘图的情况下设置 matplotlib 颜色栏的限制
我想创建一个伪彩色图(例如contour
or contourf
)和一个颜色条。出于实际原因,我希望颜色条的范围不同于底层的可映射。
在下面的示例中,数据 Z 的范围为 0 到 10000,映射到颜色图。颜色条的范围是相同的。
现在,我想在颜色条上“放大”,即生成一个范围从 3000 到 6000 的颜色条。这个新的颜色条仍应用作图例,并为每个刻度提供适当的颜色(3000 = 蓝色,6000 = 黄色)。既不cbar.set_clim()
也不cf.set_clim()
做到这一点。
matplotlib - 将颜色条的标签从递增值更改为递减值
我想将颜色条的标签从增加值更改为减少值。当我尝试通过执行此操作时vmin
,vmax
我收到错误消息:
minvalue 必须小于或等于 maxvalue
因此,例如,我希望颜色条从左侧的 20 开始,然后在右侧上升到 15。
到目前为止,这是我的颜色条代码,但在此示例中,值从 15 变为 20,我想颠倒该顺序:
python - matplotlib 中的离散颜色条
我在互联网上找到了一种使用只有 N 颜色的 colobar 的方法。这是示例
my_values
在哪里
假设我们有两个数组,x
和y
,代表随机点的位置。第三个数组 ,c
与每个点相关联,并且只能从 中获取值my_values
。
以下代码将绘制散点图,颜色条分为 7 个离散级别。
我的问题是,如何检索 7 个级别中每个级别的颜色(以 rgb、十六进制或其他形式)?
matlab - 如何添加“颜色条”并将“clim”设置为覆盖在灰度图像上的彩色图像?
我正在尝试在灰度图像上叠加彩色图像。但是,当我尝试绘制“颜色条”并设置“爬升”时。Matlab 总是根据下面的灰度图像生成一个颜色条。
但是,我想获得叠加彩色图像的颜色条。任何建议将不胜感激。非常感谢。