b8f8bbb6e8f5480174c4c49445bc0e7d952f3946,ggplot/geoms/geom_abline.py,geom_abline,_plot_unit,#geom_abline#Any#Any#,16

Before Change


            ax.set_autoscale_on(False)
            ax.plot(ax.get_xlim(),ax.get_ylim())
        else:
            start, stop = np.max(x), np.min(x)
            step = ((stop-start))  / 100.0
            x_rng = np.arange(start, stop, step)
            y_rng = x_rng * slope + intercept
            ax.plot(x_rng, y_rng, **pinfo)

After Change


        ax.set_autoscale_on(False)
        // Get plot limits
        xlim = ax.get_xlim()
        ylim = ax.get_ylim()
        // Determine line function
        line_func = lambda x: x*slope + intercept
        // Get "x" points within limit and map to "y" coordinates
        x_points = np.linspace(min(xlim),max(xlim),100)
        y_points = np.array(map(line_func,x_points))
        // detemine which points are still within the limit of the plot
        in_range = np.logical_and(y_points > min(ylim),
                                  y_points < max(ylim))
        // If some points are withinn the plot draw them on 
        if np.sum(in_range) > 0:
            x_points = x_points[in_range]
            y_points = y_points[in_range]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: has2k1/plotnine
Commit Name: b8f8bbb6e8f5480174c4c49445bc0e7d952f3946
Time: 2014-04-25
Author: eric.chiang.m@gmail.com
File Name: ggplot/geoms/geom_abline.py
Class Name: geom_abline
Method Name: _plot_unit


Project Name: tensorflow/magenta
Commit Name: e9086f5d37f5f46b8327bf022c7b0c70d42460d1
Time: 2017-03-23
Author: earnest.marshi@gmail.com
File Name: magenta/models/shared/events_rnn_graph.py
Class Name:
Method Name: build_graph


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 72e8efe6c1acc40f0b4a672a4330813e1a4066e5
Time: 2020-07-24
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/auto_attack.py
Class Name: AutoAttack
Method Name: _run_attack