コード例 #1
0
def ginput_check_points(df, rectangles, regr):
    get_ipython().magic('matplotlib auto')
    time.sleep(3)
    plt.clf()
    plt.subplot(1, 2, 1)
    plt.gca().axis('equal')
    plt.gca().set_title('triple click to quit')
    plot_rectangles(rectangles, names=True)
    plot_numbers = sorted(set(df.plot_nr))
    for nr in plot_numbers:
        d = df[df.plot_nr == nr]
        plt.plot(d.x, d.y, '.')
    return _ginput_show_info(df, _show_reg_fun(regr))
コード例 #2
0
ファイル: cookbook.py プロジェクト: larsmolstad/ffr_analysis
def test_nrs(df, plot_numbers):
    plot_rectangles(rectangles, names=True)
    for nr in plot_numbers:
        d = df[df.plot_nr == nr]
        plt.plot(d.x, d.y, '.')
コード例 #3
0
ファイル: cookbook.py プロジェクト: larsmolstad/ffr_analysis
treatments = experiment.treatments
treatment_names = sr.find_treatment_names(treatments)

#FOR REFERENCE:  This is copied from all_e22_experiments.py
#treatments = {int(x[0]): {'mixture': x[1],
#              'rock_type': x[2],
#              'fertilizer': x[3],
#              'experiment': x[4]}
    

#Plot size to show within python window, unless specified otherwise later on
plt.rcParams['figure.figsize'] = (10, 6)
  
# Displays a plot of the rectangles, as specified in the experiment file (not for buckets)
plt.cla()
plot_rectangles(rectangles)
# with treatments:
plt.cla()
keys = list(rectangles)
r = [rectangles[k] for k in keys]
tr = ['_'.join(treatments[k].values()) for k in keys]# todo
plot_rectangles(r, tr)
plt.show()

# How to do regressions: The next line makes the "regressor
# object" regr which will be used further below.  It contains the
# functions and parameters for doing the regressions.  The parameters
# are collected in the dict named options. (Organizing the code this
# way makes it easier to replace the regression function with your own
# functions.)