(fpr, tpr)
return buf
Create a pyplot plot and save to buffer.
Create a pyplot plot and save to buffer.
Create a pyplot plot and save to buffer .
def gen_plot(fpr, tpr):
    """Create a pyplot plot and save to buffer."""
    plt.figure()
    plt.xlabel("FPR", fontsize = 14)
    plt.ylabel("TPR", fontsize = 14)
    plt.title("ROC Curve", fontsize = 14)
    plot = plt.plot(fpr, tpr, linewidth = 2)
    buf = io.BytesIO()
    plt.savefig(buf, format = 'jpeg')
    buf.seek(0)
    plt.close()

    return buf
def gen_plot ( fpr , tpr ) : plt . figure ( ) plt . xlabel ( "FPR" , fontsize = 14 ) plt . ylabel ( "TPR" , fontsize = 14 ) plt . title ( "ROC Curve" , fontsize = 14 ) plot = plt . plot ( fpr , tpr , linewidth = 2 ) buf = io . BytesIO ( ) plt . savefig ( buf , format = 'jpeg' ) buf . seek ( 0 ) plt . close ( ) return buf