scripts/step3.py
def plot_states_offers(df):
    """Plots the job offers distribution in av horizontal Bar plot.

    Parameters
    ----------
    df : pandas.DataFrame
        A pandas DataFrame containing job offers data.

    """

    states_series = df["state"].value_counts()

    fig = go.Figure()

    fig.add_traces(go.Bar(x=states_series.values, y=states_series.index, text=states_series.values,
                          orientation="h", marker={"color": states_series.values, "colorscale": "tropic"}))

    fig.update_xaxes(title="Number of Job Offers", ticks="outside", ticklen=10, tickcolor="#FFFFFF",
                     linewidth=2, showline=True, mirror=True, nticks=12, title_standoff=30, gridwidth=0.5, range=[0, states_series.values.max() * 1.1])

    fig.update_yaxes(title="", ticks="outside", ticklen=10, showgrid=False,
                     tickcolor="#FFFFFF", linewidth=2, showline=True, mirror=True)

    fig.update_traces(texttemplate=" %{text:,.0f}", textposition="outside")

    # Add final customizations.
    fig.update_layout(
        uniformtext_minsize=8,
        uniformtext_mode="hide",
        showlegend=False,
        width=1200,
        height=1400,
        font_color="#FFFFFF",
        font_size=18,
        title_text="Job Offers by State",
        title_x=0.5,
        title_y=0.96,
        margin_l=120,
        margin_b=120,
        title_font_size=30,
        paper_bgcolor="#37474f",
        plot_bgcolor="#263238"
    )

    fig.write_image("3.png")
Plots the job offers distribution in av horizontal Bar plot.

    Parameters
    ----------
    df : pandas.DataFrame
        A pandas DataFrame containing job offers data.

    
Plots the job offers distribution in av horizontal Bar plot.
Parameters

df : pandas.DataFrame
A pandas DataFrame containing job offers data.
Plots the job offers distribution in av horizontal Bar plot . Parameters df : pandas . DataFrame A pandas DataFrame containing job offers data .
def plot_states_offers(df):
    states_series = df["state"].value_counts()
    fig = go.Figure()
    fig.add_traces(go.Bar(x=states_series.values, y=states_series.index, text=states_series.values,
                          orientation="h", marker={"color": states_series.values, "colorscale": "tropic"}))
    fig.update_xaxes(title="Number of Job Offers", ticks="outside", ticklen=10, tickcolor="#FFFFFF",
                     linewidth=2, showline=True, mirror=True, nticks=12, title_standoff=30, gridwidth=0.5, range=[0, states_series.values.max() * 1.1])
    fig.update_yaxes(title="", ticks="outside", ticklen=10, showgrid=False,
                     tickcolor="#FFFFFF", linewidth=2, showline=True, mirror=True)
    fig.update_traces(texttemplate=" %{text:,.0f}", textposition="outside")
    fig.update_layout(
        uniformtext_minsize=8,
        uniformtext_mode="hide",
        showlegend=False,
        width=1200,
        height=1400,
        font_color="#FFFFFF",
        font_size=18,
        title_text="Job Offers by State",
        title_x=0.5,
        title_y=0.96,
        margin_l=120,
        margin_b=120,
        title_font_size=30,
        paper_bgcolor="#37474f",
        plot_bgcolor="#263238"
    )
    fig.write_image("3.png")
def plot_states_offers ( df ) : states_series = df [ "state" ] . value_counts ( ) fig = go . Figure ( ) fig . add_traces ( go . Bar ( x = states_series . values , y = states_series . index , text = states_series . values , orientation = "h" , marker = { "color" : states_series . values , "colorscale" : "tropic" } ) ) fig . update_xaxes ( title = "Number of Job Offers" , ticks = "outside" , ticklen = 10 , tickcolor = "#FFFFFF" , linewidth = 2 , showline = True , mirror = True , nticks = 12 , title_standoff = 30 , gridwidth = 0.5 , range = [ 0 , states_series . values . max ( ) * 1.1 ] ) fig . update_yaxes ( title = "" , ticks = "outside" , ticklen = 10 , showgrid = False , tickcolor = "#FFFFFF" , linewidth = 2 , showline = True , mirror = True ) fig . update_traces ( texttemplate = " %{text:,.0f}" , textposition = "outside" ) fig . update_layout ( uniformtext_minsize = 8 , uniformtext_mode = "hide" , showlegend = False , width = 1200 , height = 1400 , font_color = "#FFFFFF" , font_size = 18 , title_text = "Job Offers by State" , title_x = 0.5 , title_y = 0.96 , margin_l = 120 , margin_b = 120 , title_font_size = 30 , paper_bgcolor = "#37474f" , plot_bgcolor = "#263238" ) fig . write_image ( "3.png" )
Plots the job offers distribution in av horizontal Bar plot.
Plots the job offers distribution in av horizontal Bar plot .
"""Plots the job offers distribution in av horizontal Bar plot.

    Parameters
    ----------
    df : pandas.DataFrame
        A pandas DataFrame containing job offers data.

    """ # Add final customizations.
df