<jupyter_start><jupyter_text>Make a Buckles Plot in Plotly<jupyter_code>import plotly.express as px
import pandas as pd
import numpy as np<jupyter_output><empty_output><jupyter_text>Linear Buckles Plot<jupyter_code>phi = [0.3, 0.3, 0.3, 0.3, 0.3, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.18, 0.18, 0.1, 0.1, 0.1, 0.1, 0.1, 0.08, 0.08, .06]
Sw = [0.14, 0.2, 0.24, 0.28, 1, 0.2, 0.3, 0.37, 0.4, 0.5, 1, 0.28, 1, 0.4, 0.6, 0.7, 0.8, 1, 0.5, 1, 1]

df = pd.DataFrame({'phi': phi, 'Sw': Sw})
fig=px.scatter(df, x="Sw", y='phi')
fig.show()<jupyter_output><empty_output><jupyter_text>Bulk Volume Water: $BVW = \phi * S_w$BVWirr = 0.04<jupyter_code>sw_test = np.linspace(0.001, 1, 100)
phi_04 = 0.04 / sw_test
phi_15 = 0.15 / sw_test
phi_1 = 0.1 / sw_test
phi_07 = 0.07 / sw_test
phi_05 = 0.05 / sw_test
import plotly.graph_objects as go

fig = go.Figure()
fig.add_trace(go.Scatter(x=Sw, y=phi,
                         mode='markers',
                         name='Data'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_04, name='BVWirr=0.4'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_15, name='BVWirr=0.15'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_1, name='BVWirr=0.1'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_07, name='BVWirr=0.07'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_05, name='BVWirr=0.05'))

fig.update_yaxes(
    scaleanchor = "x",
    scaleratio = 1,
  )
fig.update_xaxes(range=[0, 1],
                 constrain="domain")
fig.update_yaxes(range=[0, 1])<jupyter_output><empty_output><jupyter_text>Log Buckles Plot<jupyter_code>import plotly.graph_objects as go

fig = go.Figure()
fig.add_trace(go.Scatter(x=Sw, y=phi,
                         mode='markers',
                         name='Data'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_04, name='BVWirr=0.4'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_15, name='BVWirr=0.15'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_1, name='BVWirr=0.1'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_07, name='BVWirr=0.07'))
fig.add_trace(go.Scatter(x=sw_test, y=phi_05, name='BVWirr=0.05'))

fig.update_yaxes(
    scaleanchor = "x",
    scaleratio = 1,
  )
fig.update_xaxes(range=[np.log10(0.01), 0],
                 constrain="domain",
                 type='log')

fig.update_yaxes(range=[np.log10(0.01), 0],
                 type='log')
import plotly.express as px
from jupyter_dash import JupyterDash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Load Data


# Build App
app = JupyterDash(__name__)

app.layout = html.Div([
    html.H1("Fossils-JupyterDash"),
    dcc.Graph(id='graph'),
    html.Label([
        "Projection",
        dcc.Dropdown(
            id='projection-dropdown', clearable=False,
            value='umap', options=[
                {'label': c, 'value': c}
                for c in ['umap', 'tsne', 'pca']
            ])
    ]),
    
])
# Define callback to update graph
@app.callback(
    Output('graph', 'figure'),
    [Input("projection-dropdown", "value")]
)
def update_figure(proj_name):

    data_x = projection[proj_name][:, 0]
    data_y = projection[proj_name][:, 1]
    
    return px.scatter(x=data_x, 
                      y=data_y, 
                      color=y_train, 
                      render_mode="webgl", 
                      title="Projected fossil features",
                      width=800, height=600)

# Run app and display result inline in the notebook

#app.run_server(mode='external')
#app.run_server(mode='inline')
app.run_server(debug='False',port=8080,host='0.0.0.0')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16881298992161253, 'fraction_numerical': 0.055991041433370664, 'mean_word_length': 3.164335664335664, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '449193', 'license': 'MIT', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1457, 'n_words': 256, 'path': 'notebooks/Buckles Plot - Plotly.ipynb', 'repo_name': 'brendonhall/petroDash', 'size': '3572'}