plot_variable
Render a variable as a bar or histogram directly in the web page. Auto-selects chart type, excludes missing codes by default, and supports survey weights for distributions.
Instructions
把一个变量画成图,图会直接显示在网页上。kind='auto' 时自动选择:类别型画条形图(用码值含义当标签),连续数值画直方图。缺失值编码默认排除。传 weight 参数可按抽样权重加权——调查数据展示总体分布时应该加权。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | 条形图最多显示几个类别 | |
| bins | No | 直方图分几组 | |
| kind | No | auto / bar(条形图)/ histogram(直方图) | auto |
| table | Yes | 表名,如 final_HO_CSES(大小写敏感) | |
| column | Yes | 列名 | |
| schema | No | schema 名。省略时自动按表名解析 | |
| weight | No | 抽样权重列名 | |
| include_missing | No | 是否把缺失值编码也画进去(默认排除) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||