I have a contourf plot and a matplotlib.collections.LineCollection as mc plot that I drew on top of each other on the same axis but they aren't exactly on top in the case where one is shifted to the left from the other what can I do to make them be exactly on top of each other?
我有一个contourf图和一个matplotlib.collections.LineCollection作为mc图,我在同一个轴上彼此绘制但是在一个从另一个向左移动的情况下它们并不完全在顶部我是为了使它们完全相互对立?
Here is how my plot looks like :
这是我的情节的样子:
Where the parts of the blue lines are plottted using LinesCollection and the red plot using the contourf plot.
使用LinesCollection绘制蓝线部分的位置,使用contourf绘图绘制红色图。
1 个解决方案
#1
Your contourf data (in both the x and y directions) seems to go from 0 to 99 instead of 0 to 100. Meanwhile, the LineCollections endpoints seem to extend to 100. You could fix the problem by extending your contourf data to include 100, but the devil is in the details. It would be helpful to see your code. – unutbu 20 hours ago
您的contourf数据(在x和y方向)似乎从0到99而不是0到100.同时,LineCollections端点似乎扩展到100.您可以通过将contourf数据扩展为包含100来解决问题,但魔鬼在于细节。查看代码会很有帮助。 - unutbu 20小时前
#1
Your contourf data (in both the x and y directions) seems to go from 0 to 99 instead of 0 to 100. Meanwhile, the LineCollections endpoints seem to extend to 100. You could fix the problem by extending your contourf data to include 100, but the devil is in the details. It would be helpful to see your code. – unutbu 20 hours ago
您的contourf数据(在x和y方向)似乎从0到99而不是0到100.同时,LineCollections端点似乎扩展到100.您可以通过将contourf数据扩展为包含100来解决问题,但魔鬼在于细节。查看代码会很有帮助。 - unutbu 20小时前