Git Product home page Git Product logo

Comments (7)

Freed-Wu avatar Freed-Wu commented on May 27, 2024 1

No.

import numpy as np
from matplotlib import pyplot as plt
a = np.arange(10.)
a[2:5] = [np.nan] * 3
plt.plot(a)
plt.show()

a

from uniplot.

olavolav avatar olavolav commented on May 27, 2024

@Freed-Wu Thanks for the suggestion! I guess what you would want is that when plotting NaN's are silently dropped, right?

So plot([1,2,3]) should be itentical to plot([1,2,3,np.nan]), right?

from uniplot.

olavolav avatar olavolav commented on May 27, 2024

Okay got it, I'll look into it. Might be that I'll only get around to the simpler option of the above.

Let me know if you want to have a go at this yourself, and we'll coordinate

from uniplot.

Freed-Wu avatar Freed-Wu commented on May 27, 2024

Not sure. I notice another library named plotext has same problem, however, it only ignore NaN (the simpler option of the above). I maybe try to solve piccolomo/plotext#114

from uniplot.

olavolav avatar olavolav commented on May 27, 2024

@Freed-Wu It sounds like you have another solution now. In any case I've implemented the simple version we discussed in 0.6.0 and maybe I'll get around to the more sophisticated one eventually.

Thank you for your input!

from uniplot.

Freed-Wu avatar Freed-Wu commented on May 27, 2024

You are welcome. 😄

from uniplot.

olavolav avatar olavolav commented on May 27, 2024

This should now work as requested. 😄

>>> import numpy as np
>>> from uniplot import plot
>>> a = np.arange(10.)
>>> a[2:5] = [np.nan] * 3
>>> plot(a, lines=True)
┌────────────────────────────────────────────────────────────┐
│                                                        ▗▄▀▀│ 
│                                                     ▄▞▀▘   │ 8
│                                                 ▗▄▀▀       │ 
│                                              ▄▞▀▘          │ 
│                                          ▗▄▀▀              │ 
│                                       ▄▞▀▘                 │ 
│                                   ▗▄▀▀                     │ 
│                                 ▞▀▘                        │ 
│                                                            │ 
│                                                            │ 4
│                                                            │ 
│                                                            │ 
│                                                            │ 
│                                                            │ 
│                                                            │ 
│   ▗▄▞▀                                                     │ 
│▄▄▀▘▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁│ 0
└────────────────────────────────────────────────────────────┘
           2               5                7              10

from uniplot.

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.