如何在python中旋转Y轴

2024-10-01 13:43:10 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我附上了我想在python中做什么的图片

enter image description here

这是我的代码:

def HeatMapFunction(username,roundNumber,dominateFlag):
#  Connect to DB and create a Board
if(dominateFlag==0):
  print("REGULAR BOARD HAS BEEN SELECTED TO BE CREATED")
  listOfCardByRound = db.GetBoard(username, int(roundNumber))
  CreateCardBoard(listOfCardByRound)
if (dominateFlag == 1):
  print("DOMINATE BOARD HAS BEEN  SELECTED TO BE CREATED")
  listOfCardByRound = db.DominatValue(username, int(roundNumber))
  CreateDominantCardBoard(listOfCardByRound)
PDF2Image()
listOfCoodinate = db.GetCoordinateByRoundNumber(username, int(roundNumber))
xCor = []
yCor = []
#  Convert String point to float point
for x in listOfCoodinate[0]:
    xCor.append(float(x))
for y in listOfCoodinate[1]:
    yCor.append(float(y))
plt.subplots(figsize=(12, 12))
#  Calibrate the camera y axis for the image
map_img = mpimg.imread('out.jpg')
hmax = sns.kdeplot(xCor, yCor, cmap="Blues", shade=False)
hmax.collections[0].set_alpha(0)
plt.imshow(map_img, zorder=0, extent=[0, 2006, 0, 960], aspect='auto')
#  Export File to PDF
plt2PDF(plt)
webbrowser.open_new(r'testPlot.pdf')
plt.show()

我做了一个代码,我只想旋转y轴


Tags: to代码fordbifusernamepltfloat