Esempio n. 1
0
 def contour(self, ax, X, Y, C, levels=20, label=None, **kwargs):
     return Contour(
         x=X,
         y=Y,
         z=C,
         #ncontours=levels, contours=Contours(start=C.min(), end=C.max(), size=(C.max()-C.min())/levels),
         name=label,
         **kwargs)
def make_Contour(sbplt_in, x_in, y_in, Z_in):
    return Contour(
        x=x_in,
        y=y_in,
        z=Z_in,
        scl=cm_name,
        showscale=False,
        reversescl=False,
        contours=Contours(showlines=False),
        #opacity=0.8,
        xaxis='x{}'.format(sbplt_in),
        yaxis='y{}'.format(sbplt_in))
Esempio n. 3
0
    def result_plotly_contour(self,
                              min_duration=1.0,
                              max_duration=8640,
                              xscale="linear"):
        # duration_steps = np.arange(min_duration, max_duration, 1)
        # duration_steps = np.arange(5, 60, 1)
        duration_steps = np.logspace(0, 3, num=300)

        result_table = pd.DataFrame(index=duration_steps)
        heights = np.logspace(0, 2, num=300)
        # print(heights)
        # exit()
        # heights = range(1, 180, 1)
        # heights = range(0, 60, 1)

        for h in heights:
            result_table[h] = self.get_return_period(h, result_table.index)

        result_table[result_table < 0.1] = 0
        result_table[result_table > 200] = 200

        s = result_table.stack()
        z = s.values.tolist()
        y = s.index.get_level_values(1).tolist()
        x = s.index.get_level_values(0).tolist()

        axes = PlotlyAxes()
        axes.append(
            Ax(row=1,
               traces=Contour(z=z,
                              x=x,
                              y=y,
                              contours=dict(coloring='heatmap',
                                            showlabels=True,
                                            labelfont=dict(family='Raleway',
                                                           size=12,
                                                           color='white')),
                              name='Wiederkehrperiode in [Jahre]',
                              colorscale='Rainbow',
                              colorbar=dict(
                                  title='Wiederkehrperiode in [Jahre]',
                                  titleside='right'),
                              hoverinfo='x+y+z+name'),
               ylabel='Regenhöhe in [mm]',
               xlabel='Dauerstufe in [min]'))

        fig = axes.get_figure()
        fig.set_size(w=1800, h=1000)
        fig.set_title('Regenhöhenlinien')
        file = self.output_filename + '_countour_plot'
        fig.save(file)
def make_2d_surface_trace(gp_mu_folded, x_gp, y_gp, z_axis_title):
    trace = Contour(
        z=gp_mu_folded,
        x=x_gp,
        y=y_gp,
        colorscale='Viridis',
        colorbar={
            'title': z_axis_title,
            'titleside': 'right'
        },
        opacity=0.9,
        line=dict(width=1, smoothing=0.85),
        contours=dict(
            # showlines=False,
            # showlabels=False,
            coloring="heatmap",
            start=min(gp_mu),
            end=max(gp_mu),
            size=0.05,
            labelfont=dict(size=15, ),
        ))
    return trace
Esempio n. 5
0
                            "color": "lime"
                        }
                    },
                ])

real_price = get_history("bitcoinity_data.csv",
                         tcs[-1],
                         delta_t=0,
                         length=len(tcs),
                         col="kraken")

plots = list()
plots.append(
    Contour(z=lm_all,
            y=sample_sizes,
            x=tcs,
            colorscale=my_color,
            showscale=False))
plots.append(
    Contour(z=keep_all,
            y=sample_sizes,
            x=tcs,
            colorscale=filter_color,
            showscale=False,
            opacity=0.5,
            contours=dict(showlines=False)))
plots.append(
    Scatter(y=real_price.price,
            x=tcs,
            yaxis="y2",
            name="Bitcoin",
Esempio n. 6
0
def test_nested_list():
    z = [[
        1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
        21
    ]]
    print(Contour(z=z).to_string())
Esempio n. 7
0
#mean: 0.98048, std: 0.00063, params: {'C': 5}
#mean: 0.98029, std: 0.00068, params: {'C': 10}
#mean: 0.98019, std: 0.00067, params: {'C': 20}
#mean: 0.98017, std: 0.00064, params: {'C': 50}
#mean: 0.98017, std: 0.00064, params: {'C': 100}

pca85p_svc_best_estimator = pca85p_svc_model_gsearch.best_estimator_

pd.DataFrame({'ImageId': np.arange(28000) + 1, 'Label': pca85p_svc_best_estimator.predict(test_pca85p_x)}).to_csv("D:/Users/perry/Downloads/pca85p_svc_gridsearch.csv", index = False)


plotly.offline.plot(
  [Contour(
    z = [[0.97600, 0.97848, 0.97955, 0.97924, 0.97914, 0.97845, 0.97855], 
         [0.97881, 0.98048, 0.98079, 0.98060, 0.98017, 0.98017, 0.98017], 
         [0.97767, 0.98026, 0.98048, 0.98029, 0.98019, 0.98017, 0.98017]], 
    x = [1, 2, 5, 10, 20, 50, 100], 
    y = [0.7, 0.8, 0.85]
  )]
)