如何使用gnuplot突出显示区域的区域

时间:2015-06-04 16:55:49

标签: gnuplot highlight radar-chart

如果有人可以帮助解决这个问题,我会很感激。 我正在使用gnuplot 5.0.0的雷达(或蜘蛛网)情节:

enter image description here

所有轴的比例和范围都相同。 1及以上的数字具有特殊含义,我想强调一下。

我在想三件可以提高知名度的事情:

  1. 只需将刻度线标记为1(标记为“限制”)粗体。我怎样才能突出显示特定的刻度和标签?

  2. 我还可以突出显示第1级的圆形虚线

  3. 在情节本身上,我希望背景颜色与半径不同> 1.

  4. 如何实现上述三个选项中的任何一个?当然,所有这三个都是理想的,但只是与该值的其余部分的最小差异将有所帮助。

    这是在链接中生成图表的内容:

    set term x11
    set title "My title "
    set polar
    set angles degrees
    npoints = 6
    
    a1 = 360/npoints*1
    a2 = 360/npoints*2
    a3 = 360/npoints*3
    a4 = 360/npoints*4
    a5 = 360/npoints*5
    a6 = 360/npoints*6
    
    set grid polar 360
    set size square
    set style data lines
    
    unset border
    
    set grid ls 0
    set linetype 1 lc rgb 'red' lw 2 pt 7 ps 2
    
    M=2.2
    set arrow from 0,0 to first M*cos(a1), M*sin(a1)
    set arrow from 0,0 to first M*cos(a2), M*sin(a2)
    set arrow from 0,0 to first M*cos(a3), M*sin(a3)
    set arrow from 0,0 to first M*cos(a4), M*sin(a4)
    set arrow from 0,0 to first M*cos(a5), M*sin(a5)
    set arrow from 0,0 to first M*cos(a6), M*sin(a6)
    
    a1_min = 0
    a1_max = 1
    a2_min = 0
    a2_max = 1
    a3_min = 0
    a3_max = 1
    a4_min = 0
    a4_max = 1
    a5_min = 0
    a5_max = 1
    a6_min = 0
    a6_max = 1
    
    set label "M1" at M*cos(a1),M*sin(a1) center offset char 1,1
    set label "M2" at M*cos(a2),M*sin(a2) center offset char 1,1
    set label "M3" at M*cos(a3),M*sin(a3) center offset char 1,1
    set label "M4" at M*cos(a4),M*sin(a4) center offset char 1,1
    set label "M5" at M*cos(a5),M*sin(a5) center offset char 1,1
    set label "M6" at M*cos(a6),M*sin(a6) center offset char 1,1
    
    
    set xrange [0:1]
    set yrange [0:1]
    
    set xtics axis 0,0.5,M
    unset ytics
    
    set rrange [0:M]
    
    set rtics (""0,""0.25,""0.5,""0.75,"Limit"1,""1.25,""1.50,""1.75,""2)
    set rtics scale 0 format ''
    
    set style fill transparent solid 0.5
    set style function filledcurves y1=0.5
    set grid noxtics nomxtics noytics nomytics front
    
    
    plot  '-' u ($1==1?a1:($1==2?a2:($1==3?a3:($1==4?a4:($1==5?a5:($1==6?a6:$1)))))):($1==1?(($2-a1_min)/(a1_max-a1_min)):($1==2?(($2-a2_min)/(a2_max-a2_min)):($1==3?(($2-a3_min)/(a3_max-a3_min)):($1==4?(($2-a4_min)/(a4_max-a4_min)):($1==5?(($2-a5_min)/(a5_max-a5_min)):($1==6?(($2-a6_min)/(a6_max-a6_min)):$1)))))) w filledcurve lt 1 title "AAA",\
     '-' u ($1==1?a1:($1==2?a2:($1==3?a3:($1==4?a4:($1==5?a5:($1==6?a6:$1)))))):($1==1?(($2-a1_min)/(a1_max-a1_min)):($1==2?(($2-a2_min)/(a2_max-a2_min)):($1==3?(($2-a3_min)/(a3_max-a3_min)):($1==4?(($2-a4_min)/(a4_max-a4_min)):($1==5?(($2-a5_min)/(a5_max-a5_min)):($1==6?(($2-a6_min)/(a6_max-a6_min)):$1)))))) w filledcurve lt 2 title "BBB"
    
    1 2.1
    2 1
    3 0.1
    4 0.5
    5 0.5
    6 0.1
    1 2.1
    EOF
    1 2.2
    2 0.9
    3 0.9
    4 0.2
    5 0.3
    6 0.1
    1 2.2
    EOF
    set output
    

1 个答案:

答案 0 :(得分:3)

我冒昧地简化了你的脚本,你现在可以轻松调整网页中的武器数量。还为1> r>添加了彩色背景。微米。

顺便说一句,没有必要在最后再次输入第一个数据点以关闭轮廓。 更新:也就是说,不应该有。然而,即使将“关闭”选项赋予“with filledcurve”,最后一点和第一点之间的线也会丢失。我想知道这是不是一个错误。

  class Collection < ActiveRecord::Base
      belongs_to :user
      has_many :follows

      def links_count
          follows.count
      end

      def add_link(url)
          status, options, link = Link.link_exist?(url)
          unless status
              options = Utils.parse_page(url)
              link = Link.create(options)
              link.download_image!
          end
          link.follow_link({:collection_id => self.id, :user_id => user_id})
      end

      def self.user_collections(options)
          conds = []
          conds << " user_id = #{options["user_id"]}" if options["user_id"].present?
          conds = conds.blank? ? [] : conds.join(" AND ")
          Collection.where(conds).order("updated_at DESC").page(options["page"]).per(16)
      end
  end