我想绘制RGB图像的3D直方图。 以下是我的代码:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
from scipy.misc import imread
import pylab
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
img1 = imread('image.jpg')
img_reshaped = img1.reshape(img1.shape[0] * img1.shape[1], img1.shape[2])
hist, edges = np.histogramdd(img_reshaped, bins=(100, 100, 100))
请告诉我如何绘制我获得的hist
直方图。
答案 0 :(得分:0)
您是否看过matplotlib图库中的3d直方图示例?