Giter Club home page Giter Club logo

Comments (2)

piccolomo avatar piccolomo commented on August 22, 2024

Dear Schmetzler,

thanks for the bug report. That is a real bug which I have now fixed (but not published yet).

The problem is that, due to the size of the data pixel, each time the limits of the plot are calculated, they are set slightly bigger then the data set. The bug is due to the fact that the limits were calculated from the already expanded version and so each time you plot the limits expand and the plot appears to shrink.

I should upload a new version soon with the bug fixed. In the mean time I recommend using the clear_plot function before each plot to avoid this problem.

Thanks, Savino

from plotext.

piccolomo avatar piccolomo commented on August 22, 2024

Dear Schmetzler,

I have just upgraded plotext to a new version which solved the bug you reported.
Here is the code:

import numpy as np
plt.scatter([10,2,3,5,2,1,5,13,4,2,5,3,2,1,5,6,17,12,15,4,5,4,3,2,5,6,9,8,12,18,5,3,2],rows=10,cols=25)
plt.show()
plt.show()
plt.show()

And the expected output:

                      •  ├ 17.8
            •            │     
              •          ├ 13.6
     •       •       •   │     
•                        ├ 9.4 
                    •    │     
           •       •     │     
  •  •• •  •  ••• •    • ├ 5.2 
 •••   •••       •     ••│     
    •     •              ├ 1.0 
┬─────┬─────┬─────┬─────┬┘     
0     8     16    24    32     

                      •  ├ 17.8
            •            │     
              •          ├ 13.6
     •       •       •   │     
•                        ├ 9.4 
                    •    │     
           •       •     │     
  •  •• •  •  ••• •    • ├ 5.2 
 •••   •••       •     ••│     
    •     •              ├ 1.0 
┬─────┬─────┬─────┬─────┬┘     
0     8     16    24    32     

                      •  ├ 17.8
            •            │     
              •          ├ 13.6
     •       •       •   │     
•                        ├ 9.4 
                    •    │     
           •       •     │     
  •  •• •  •  ••• •    • ├ 5.2 
 •••   •••       •     ••│     
    •     •              ├ 1.0 
┬─────┬─────┬─────┬─────┬┘     
0     8     16    24    32     

You can upgrade your plotext version using pip install plotext --upgrade and access the package documentation at pypi:plotext and github:plotext.
The package has been just upgraded so there may be further issues: feel free to report any other, cause it is helpful! :-)

I hope it was useful and all the best using the package !

Savino

from plotext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.