Linux command
termgraph 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create bar chart from file
termgraph [data.txt]
Create chart with custom title
termgraph --title "[Monthly Sales]" [data.txt]
Create colored chart
termgraph --color [red] [data.txt]
Create vertical bar chart
termgraph --vertical [data.txt]
Create stacked bar chart
termgraph --stacked [data.txt]
Create histogram
termgraph --histogram --bins [10] [data.txt]
Customize chart width
termgraph --width [80] [data.txt]
Create chart from stdin
cat [data.txt] | termgraph
说明
termgraph is a Python command-line tool that draws basic graphs in the terminal. It supports bar charts, stacked charts, histograms, calendar heatmaps, and can display graphs horizontally or vertically. Data is provided in a simple format with labels in the first column and numeric values in subsequent columns, separated by commas or spaces. Multiple value columns create grouped or stacked charts. The tool supports emoji characters as tick marks, enabling creative visualizations. It can also be used as a Python library for programmatic chart generation. Install via pip: `pip install termgraph`
参数
- --title _title_
- Title displayed above the graph.
- --width _n_
- Width of graph in characters (default: 50).
- --format _format_
- Format specifier for values.
- --suffix _suffix_
- String appended to all data points.
- --no-labels
- Hide label column.
- --no-values
- Hide values at end of bars.
- --space-between
- Print newline after each row.
- --color _color_
- Bar color(s): red, blue, green, magenta, yellow, black, cyan.
- --vertical
- Display vertical bars.
- --stacked
- Display stacked bar chart.
- --histogram
- Display histogram from raw data.
- --bins _n_
- Number of histogram bins.
- --different-scale
- Use different scales per category.
- --calendar
- Display calendar heatmap.
- --start-dt _date_
- Start date for calendar chart.
- --custom-tick _char_
- Custom tick mark character (emoji supported).
- --delim _char_
- Custom delimiter (default: comma or space).
- --verbose
- Enable verbose output.
FAQ
What is the termgraph command used for?
termgraph is a Python command-line tool that draws basic graphs in the terminal. It supports bar charts, stacked charts, histograms, calendar heatmaps, and can display graphs horizontally or vertically. Data is provided in a simple format with labels in the first column and numeric values in subsequent columns, separated by commas or spaces. Multiple value columns create grouped or stacked charts. The tool supports emoji characters as tick marks, enabling creative visualizations. It can also be used as a Python library for programmatic chart generation. Install via pip: `pip install termgraph`
How do I run a basic termgraph example?
Run `termgraph [data.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --title _title_ do in termgraph?
Title displayed above the graph.