gnuplot在字符串上绘制直方图

gnuplot在字符串上绘制直方图,plot,gnuplot,Plot,Gnuplot,我有一列这样格式化的数据 Chicago Chicago New York Chicago Boulder Boulder Chicago Los Angeles San Diego Chicago 我正在尝试使用gnuplot绘制列中每个城市的计数。有什么想法吗?Gnuplot无法做到这一点。您可以使用sort和uniq命令行工具来预处理数据: set boxwidth 0.7 set yrange [0:*] set style fill solid noborder plot "<

我有一列这样格式化的数据

Chicago
Chicago
New York
Chicago
Boulder
Boulder
Chicago
Los Angeles
San Diego
Chicago

我正在尝试使用gnuplot绘制列中每个城市的计数。有什么想法吗?

Gnuplot无法做到这一点。您可以使用
sort
uniq
命令行工具来预处理数据:

set boxwidth 0.7
set yrange [0:*]
set style fill solid noborder
plot "< sort 'file.dat' | uniq -c" u 0:1:xtic(2) with boxes
将箱宽设置为0.7
设置Y范围[0:]
设置样式填充顺序
用方框绘制“