[英]Matplotlib : How to plot two bar plots with the same x/y axes but one start over the other along y axis
我正在嘗試 plot 兩個條形圖 int 相同的數字。 在下面的代碼中,這些圖一個接一個,因為它們沿 y 軸位於 0 處。
import matplotlib.pyplot as plt
import numpy as np
y1=np.array([1,2,3,4,5])
x1=np.array([1,2,3,2,1])
x2=np.array([1,2,3,2,1])
y2=np.array([6,7,8,9,10])
plt.bar(y1,x1)
plt.bar(y2,x2)
我會橙色條 plot 從坐標開始:(x=6,y=3)。 所以橙色條 plot 應該超過藍色 plot 並在同一個圖中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.