久久久久久久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>
                          • 主站蜘蛛池模板: 国产精品一区一区 | 91精品国产一区二区三区动漫 | 久草青青| 大陆一级毛片免费视频观看 | 中文字幕亚洲精品 | 中文字幕免费在线 | 日本免费在线看 | 91精品国产一区二区在线观看 | 欧美一区二区三区,视频 | 午夜tv免费观看 | 人人干人人爽 | aaa精品| 精品久久久久久久久久久院品网 | 免费一级片 | 91电影在线| 日日骚网 | 欧美成人在线影院 | 美日韩中文字幕 | 国产做a爱片久久毛片 | 久草视频在线播放 | 久久亚洲91| 精品久久久久久久 | 久草热线 | 久久com| a级大片免费观看 | 欧美成视频 | 久久av一区二区三区 | 国产偷录视频叫床高潮对白 | 啪啪av| 国产我和子的乱视频网站 | 欧美日韩在线免费 | 中文字幕亚洲视频 | 亚洲欧美日韩精品久久亚洲区 | 欧美日韩综合精品 | 人妖一区| 精品乱码一区二区三四区视频 | 亚洲视频二区 | 国产一级淫片免费视频 | 欧美精品乱码久久久久久按摩 | 国产美女精品视频免费观看 | 成人一区二区在线 |