小编Fat*_*a90的帖子

Python Min and Max range for Color bar on Matplotlib Contour Graph

I am trying to edit the colorbar range on my contour graph from 0 to 0.12, I have tried a few things but it hasn't worked. I keep getting the full color bar range up until 0.3 which is not what I want.

This is my code:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.tri as tri
triang = tri.Triangulation(x, y)

plt.tricontour(x, y, z, 15, colors='k')

plt.tricontourf(x, y, z, 15, cmap='Blues', vmin=0, vmax=0.12,\
                extend ='both')
plt.colorbar()

plt.clim(0,0.12)

plt.ylim …
Run Code Online (Sandbox Code Playgroud)

python colors matplotlib contour colorbar

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

colorbar ×1

colors ×1

contour ×1

matplotlib ×1

python ×1