Giter Club home page Giter Club logo

Comments (3)

piccolomo avatar piccolomo commented on August 22, 2024 1

Hi cassiobattista,

thanks for your feedback Try using the fillx = True option inside the plotting function you are using.

More precisely:

  • fillx = True fills the area between the data and the x axis with data points (if used inside scatter) or line points (if used inside plot). For example: plt.plot(data, fillx = True). By default fillx = False
  • filly = True fills the area between the data and the y axis with data points (if used inside scatter) or line points (if used inside plot). For example: plt.plot(data, filly = True). By default filly = False

Did it help?
Savino

from plotext.

cassiotbatista avatar cassiotbatista commented on August 22, 2024 1

That worked like a charm @piccolomo, thank you so much! It looks more a bar chart than a stem plot, but that's fine by me.

I'm dropping a screenshot and a code snippet for reference :)

Screenshot from 2021-05-20 08-04-38

    # @count_r and @count_h are OrderedDict()'s in the form x['aa'] = 0.99, x['ac'] = 0.25, etc.  
    logger.info("plotting via plotext")
    rticks = [x - 0.1 for x in range(len(count_r))]
    hticks = [x + 0.1 for x in range(len(count_h))]
    txp.scatter(rticks, count_r.values(), point_color='red',    fillx=True, label="baseline (pre VC)", point_marker=9)
    txp.scatter(hticks, count_h.values(), point_color='yellow', fillx=True, label="modified (post VC)", point_marker=8)
    txp.xticks(range(len(count_r)), count_r.keys())

    #txp.nocolor()
    txp.canvas_color("none") ; txp.axes_color("none") ; txp.ticks_color("white")
    txp.figsize(160, 40)
    txp.xlim([-0.5, len(count_r) + 0.1]) ; txp.ylim([0.0, 0.11])
    txp.xlabel("phoneme tokens") ; txp.ylabel("frequency (percentage, sums to 1)")
    txp.show()

from plotext.

piccolomo avatar piccolomo commented on August 22, 2024

Hi @cassiobatista ,

the newest version (3.0.0) of plotext is now available at this link.

Among the many changes, the stem plot is also available.

Hope it help and thanks for help!
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.