Skip to content

FloatSlider and IntSlider didn't show up!  #3207

@tasanyphy01773

Description

@tasanyphy01773

I'm using ipywidget for metPy dewdrop calculator. But the sliders didn't show up when I run the code.
My Code:
image

import metpy.calc as mpcalc
from metpy.units import units 

from ipywidgets import interact, FloatSlider, IntSlider

def dewpoint_calculator(temperature, rh):
    temperature = temperature * units.degC
    rh = rh * units.percent
    return round(mpcalc.dewpoint_from_relative_humidity(temperature, rh).to('degC'), 1)

temp_slider = FloatSlider(min=0, max=100, step=0.5, value= 50)
rh_slider = IntSlider(min=0, max=100, value= 50)

interact(dewpoint_calculator, temperature=temp_slider, rh =rh_slider);

It should be like this:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions