久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='XBXfc'><tr id='XBXfc'><dt id='XBXfc'><q id='XBXfc'><span id='XBXfc'><b id='XBXfc'><form id='XBXfc'><ins id='XBXfc'></ins><ul id='XBXfc'></ul><sub id='XBXfc'></sub></form><legend id='XBXfc'></legend><bdo id='XBXfc'><pre id='XBXfc'><center id='XBXfc'></center></pre></bdo></b><th id='XBXfc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='XBXfc'><tfoot id='XBXfc'></tfoot><dl id='XBXfc'><fieldset id='XBXfc'></fieldset></dl></div>
    • <bdo id='XBXfc'></bdo><ul id='XBXfc'></ul>

    <small id='XBXfc'></small><noframes id='XBXfc'>

      <tfoot id='XBXfc'></tfoot>
      1. <legend id='XBXfc'><style id='XBXfc'><dir id='XBXfc'><q id='XBXfc'></q></dir></style></legend>

        將 x 軸刻度更改為自定義字符串

        Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)

          <i id='ARkYo'><tr id='ARkYo'><dt id='ARkYo'><q id='ARkYo'><span id='ARkYo'><b id='ARkYo'><form id='ARkYo'><ins id='ARkYo'></ins><ul id='ARkYo'></ul><sub id='ARkYo'></sub></form><legend id='ARkYo'></legend><bdo id='ARkYo'><pre id='ARkYo'><center id='ARkYo'></center></pre></bdo></b><th id='ARkYo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ARkYo'><tfoot id='ARkYo'></tfoot><dl id='ARkYo'><fieldset id='ARkYo'></fieldset></dl></div>

            <bdo id='ARkYo'></bdo><ul id='ARkYo'></ul>
          • <small id='ARkYo'></small><noframes id='ARkYo'>

                <tfoot id='ARkYo'></tfoot>
                    <tbody id='ARkYo'></tbody>
                1. <legend id='ARkYo'><style id='ARkYo'><dir id='ARkYo'><q id='ARkYo'></q></dir></style></legend>

                  本文介紹了將 x 軸刻度更改為自定義字符串的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想將 x 軸刻度標簽更改為自定義字符串,但以下不起作用.如何將刻度標簽設置為 [one"、two"、three"]?

                  I want to change the x-axis ticklabels to custom strings, but the following does not work. How can I set the ticklabels to ["one", "two", "three"]?

                  from PyQt5.QtWidgets import *
                  from PyQt5.QtGui import *
                  import matplotlib.pyplot as plt
                  
                  def pushButtonClicked(self):
                          code = self.lineEdit.text()
                         
                         
                          x=["one","two","three"]
                          l=[1,2,3]
                          y=[2,3,4]
                          ax = self.fig.add_subplot(111)
                         
                          print(1)
                          
                          ax.plot(l, y, label='DeadPopulation')
                          ax.xticks(l,x)
                          print(IntroUI.g_sortArrayDeadcnt)
                        
                          ax.legend(loc='upper right') 
                          ax.grid() 
                          self.canvas.draw()
                  

                  推薦答案

                  我假設您只想將刻度設置為等于 ['one', 'two', 'three']?

                  I assume you just want to set the ticks to be equal to ['one', 'two', 'three']?

                  為此,您需要使用 set_xticks()set_xticklabels():

                  To do this, you need to use set_xticks() and set_xticklabels():

                  from PyQt5.QtWidgets import *
                  from PyQt5.QtGui import *
                  import matplotlib.pyplot as plt
                  
                  def pushButtonClicked(self):
                          code = self.lineEdit.text()
                  
                  
                          x=["one","two","three"]
                          l=[1,2,3]
                          y=[2,3,4]
                          ax = self.fig.add_subplot(111)
                  
                          print(1)
                  
                          ax.plot(l, y, label='DeadPopulation')
                  
                          # Set the tick positions
                          ax.set_xticks(l)
                          # Set the tick labels
                          ax.set_xticklabels(x)
                  
                          print(IntroUI.g_sortArrayDeadcnt)
                  
                          ax.legend(loc='upper right') 
                          ax.grid() 
                          self.canvas.draw()
                  

                  小例子

                  import matplotlib.pyplot as plt
                  f, ax = plt.subplots()
                  
                  x = ['one', 'two', 'three']
                  l = [1, 2, 3]
                  y = [2, 3, 4]
                  
                  ax.plot(l,y)
                  ax.set_xticks(l)
                  ax.set_xticklabels(x)
                  
                  plt.show()
                  

                  下面是它的樣子:

                  這篇關于將 x 軸刻度更改為自定義字符串的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)
                  Erasing pen on a canvas(在畫布上擦筆)

                  <small id='J65iB'></small><noframes id='J65iB'>

                    <tbody id='J65iB'></tbody>

                2. <tfoot id='J65iB'></tfoot>
                  <i id='J65iB'><tr id='J65iB'><dt id='J65iB'><q id='J65iB'><span id='J65iB'><b id='J65iB'><form id='J65iB'><ins id='J65iB'></ins><ul id='J65iB'></ul><sub id='J65iB'></sub></form><legend id='J65iB'></legend><bdo id='J65iB'><pre id='J65iB'><center id='J65iB'></center></pre></bdo></b><th id='J65iB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='J65iB'><tfoot id='J65iB'></tfoot><dl id='J65iB'><fieldset id='J65iB'></fieldset></dl></div>
                    <bdo id='J65iB'></bdo><ul id='J65iB'></ul>

                      1. <legend id='J65iB'><style id='J65iB'><dir id='J65iB'><q id='J65iB'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 中文字幕第九页 | 人人爽人人爽 | 成年人的视频免费观看 | 少妇午夜一级艳片欧美精品 | 日韩欧美一区在线 | 亚洲成人一区二区三区 | 国产精品999 | 黑人巨大精品 | 国产一区二区在线视频 | 秋霞在线一区二区 | 黄色大片免费网站 | 亚洲午夜三级 | 亚洲天天干 | 日产精品久久久一区二区福利 | 国产伦精品一区二区三区四区视频 | 黄视频免费在线 | www.国产 | 国产麻豆乱码精品一区二区三区 | 成人在线电影网站 | 91 久久| 日韩在线视频免费观看 | 精品不卡 | 久久亚洲精品国产精品紫薇 | 欧美激情一区二区三区 | 亚洲第一区国产精品 | 午夜精品久久久久久久星辰影院 | 国产成年人视频 | 色爱综合网 | 午夜电影网 | 色橹橹欧美在线观看视频高清 | 精品一区av | 国产成人精品一区二区三区四区 | 日韩欧美精品在线 | 国产精品观看 | 中文字幕亚洲一区 | 九九综合九九 | 国产成人在线一区 | 亚洲国产视频一区二区 | 国产精品免费一区二区三区 | 日韩高清一区 | 久久乐国产精品 |