<i id='4WsBr'><tr id='4WsBr'><dt id='4WsBr'><q id='4WsBr'><span id='4WsBr'><b id='4WsBr'><form id='4WsBr'><ins id='4WsBr'></ins><ul id='4WsBr'></ul><sub id='4WsBr'></sub></form><legend id='4WsBr'></legend><bdo id='4WsBr'><pre id='4WsBr'><center id='4WsBr'></center></pre></bdo></b><th id='4WsBr'></th></span></q></dt></tr></i><div id='4WsBr'><tfoot id='4WsBr'></tfoot><dl id='4WsBr'><fieldset id='4WsBr'></fieldset></dl></div>
    <tfoot id='4WsBr'></tfoot>
    1. <legend id='4WsBr'><style id='4WsBr'><dir id='4WsBr'><q id='4WsBr'></q></dir></style></legend>

      <small id='4WsBr'></small><noframes id='4WsBr'>

        <bdo id='4WsBr'></bdo><ul id='4WsBr'></ul>

        如何显示matplotlib图?

        How to show matplotlib plots?(如何显示matplotlib图?)

              <legend id='nBI5S'><style id='nBI5S'><dir id='nBI5S'><q id='nBI5S'></q></dir></style></legend>

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

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

                  本文介绍了如何显示matplotlib图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我确定python的matplotlib配置是正确的,因为我已经用它绘制了一些图形。

                  但今天,由于某些原因,它只是停止工作了。我用非常简单的代码进行了测试,如下所示:

                  import matplotlib.pyplot as plt
                  import numpy as np
                  x = np.arange(0, 5, 0.1)
                  y = np.sin(x)
                  plt.plot(x, y)
                  

                  没有错误,只是没有显示任何图形。

                  我在Ubuntu中使用的是python 2.6,Eclipse

                  推荐答案

                  在matplotlib中有两个主要选项:

                  1. 创建您的曲线图并在末尾绘制它们:

                    import matplotlib.pyplot as plt
                    
                    plt.plot(x, y)
                    plt.plot(z, t)
                    plt.show()
                    
                  2. 创建绘图并在创建后立即绘制:

                    import matplotlib.pyplot as plt
                    from matplotlib import interactive
                    interactive(True)
                    
                    plt.plot(x, y)
                    raw_input('press return to continue')
                    
                    plt.plot(z, t)
                    raw_input('press return to end')
                    

                  这篇关于如何显示matplotlib图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Split a Pandas column of lists into multiple columns(将 Pandas 的列表列拆分为多列)
                  How does the @property decorator work in Python?(@property 装饰器在 Python 中是如何工作的?)
                  What is the difference between old style and new style classes in Python?(Python中的旧样式类和新样式类有什么区别?)
                  How to break out of multiple loops?(如何打破多个循环?)
                  How to put the legend out of the plot(如何将传说从情节中剔除)
                  Why is the output of my function printing out quot;Nonequot;?(为什么我的函数输出打印出“无?)
                • <tfoot id='5nGXl'></tfoot>

                    1. <i id='5nGXl'><tr id='5nGXl'><dt id='5nGXl'><q id='5nGXl'><span id='5nGXl'><b id='5nGXl'><form id='5nGXl'><ins id='5nGXl'></ins><ul id='5nGXl'></ul><sub id='5nGXl'></sub></form><legend id='5nGXl'></legend><bdo id='5nGXl'><pre id='5nGXl'><center id='5nGXl'></center></pre></bdo></b><th id='5nGXl'></th></span></q></dt></tr></i><div id='5nGXl'><tfoot id='5nGXl'></tfoot><dl id='5nGXl'><fieldset id='5nGXl'></fieldset></dl></div>

                        <small id='5nGXl'></small><noframes id='5nGXl'>

                        • <legend id='5nGXl'><style id='5nGXl'><dir id='5nGXl'><q id='5nGXl'></q></dir></style></legend>

                          • <bdo id='5nGXl'></bdo><ul id='5nGXl'></ul>
                              <tbody id='5nGXl'></tbody>