我正在研究一个半透明的'x'标记(20%alpha)的情节.如何使标记在图例中以100%不透明度显示?
import matplotlib.pyplot as plt
plt.plot_date( x = xaxis, y = yaxis, marker = 'x', color=[1, 0, 0, .2], label='Data Series' )
plt.legend(loc=3, mode="expand", numpoints=1, scatterpoints=1 )
Run Code Online (Sandbox Code Playgroud) 我正在使用ax.axes('equal')使 X 和 Y 上的轴间距相等,并设置xlim和ylim。这过度限制了问题,实际限制不是我在ax.set_xlim()或 中设置的ax.set_ylim()。使用ax.get_xlim()只返回我提供的内容。如何获得绘图的实际可见限制?
f,ax=plt.subplots(1) #open a figure
ax.axis('equal') #make the axes have equal spacing
ax.plot([0,20],[0,20]) #test data set
#change the plot axis limits
ax.set_xlim([2,18])
ax.set_ylim([5,15])
#read the plot axis limits
xlim2=array(ax.get_xlim())
ylim2=array(ax.get_ylim())
#define indices for drawing a rectangle with xlim2, ylim2
sqx=array([0,1,1,0,0])
sqy=array([0,0,1,1,0])
#plot a thick rectangle marking the xlim2, ylim2
ax.plot(xlim2[sqx],ylim2[sqy],lw=3) #this does not go all the way around the edge
Run Code Online (Sandbox Code Playgroud)
什么命令可以让我在图形的实际边缘周围绘制绿色框?
相关阅读:力 …
如何转换使用彩虹颜色图的图形(例如图1),以便使用不同的颜色图(例如感知均匀的顺序图)显示相同的数据?
假设生成原始图像的基础数据不可访问,并且图像本身必须仅使用图像内的信息重新着色。
背景信息:彩虹色贴图往往会产生视觉伪影。看到 z = -1.15 m 附近的青色线了吗?看起来那里有一个锋利的边缘。但看看颜色条本身!甚至颜色条也有边缘。黄色带中还有另一个假边缘,垂直靠近 R = 1.45 m。水平黄色条纹可能是基础数据中的真实边缘,尽管很难将这种情况与彩虹伪影区分开来。
更多信息: