【问题标题】:plotting bar chart in gnuplot directly without input file在没有输入文件的情况下直接在gnuplot中绘制条形图
【发布时间】:2020-11-05 05:49:27
【问题描述】:

我正在关注plot bar graphs in Gnuplot,但我无法绘制我的数据。这是它的样子

这是我的代码

!/usr/bin/gnuplot -persist

  
set boxwidth 0.5
set style fill solid

plot  (1,"label1",664;2,"label2",331) using 1:3:xtic(2) with boxes

错误

plot  (1,"label1",664;2,"label2",331) using 1:3:xtic(2) with boxes
                     ^
"./test.sh", line 10: ')' expected

【问题讨论】:

    标签: linux gnuplot bar-chart


    【解决方案1】:

    使用数据块保存在线数据

    $data <<EOD
    1 "label" 664
    2 "label2" 331
    EOD
    
    set boxwidth 0.5
    set style fill solid
    
    plot  $data using 1:3:xtic(2) with boxes
    

    【讨论】:

    • 如何设置 xrange 和 yrange 如示例图所示?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-02
    • 2018-12-03
    • 2016-01-14
    相关资源
    最近更新 更多