Git Product home page Git Product logo

Comments (2)

HanxunH avatar HanxunH commented on July 20, 2024
def plot_lines(data, labels=[], colors=[], linestyles=[], width=[], xticks=None, x_label=None, y_label=None,
               title=None, filename=None):
    fig = plt.figure(figsize=(10, 10), dpi=120)
    for i, item in enumerate(data):
        plt.plot(item, label=labels[i], color=colors[i], linewidth=width[i], linestyle=linestyles[i])
    if x_label is not None:
        plt.xlabel(x_label, size=42)
    if y_label is not None:
        plt.ylabel(y_label, size=42)
    if xticks is not None: 
        plt.xticks(range(len(xticks)), xticks, size=42)
    plt.ylim(0.3, 1.05)
    plt.yticks(size=36)
    plt.xticks(size=36)
    plt.legend(loc='lower right', fontsize=32, ncol=1)
    if title is not None:
        plt.title(title, size=42)
    if filename is not None:
        plt.savefig(filename, bbox_inches='tight')
    plt.show()
    plt.close()

from unlearnable-examples.

Weixiang-Sun avatar Weixiang-Sun commented on July 20, 2024

Tks!

from unlearnable-examples.

Related Issues (19)

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.