require 'nyaplot' Nyaplot::Colors.lists Nyaplot::Colors.Pastel2 Nyaplot::Colors.jet Nyaplot::Colors.GnBu Nyaplot::Colors.binary Nyaplot::Colors.seq Nyaplot::Colors.div Nyaplot::Colors.qual Nyaplot::Colors.seq(3) Nyaplot::Colors.Spectral(11) Nyaplot::Color.new(["#DEDEDE", "#ACACAC", "#1F141C", "#4A173D", "#8C547E"]) plot = Nyaplot::Plot.new bar = plot.add(:bar, ['Persian', 'Maine Coon', 'American Shorthair'], [10,20,30]) plot.show colors = Nyaplot::Colors.qual(3) bar.color(colors) plot.show x=[]; y=[]; fill=[] -5.step(5, 1) do |i| -5.step(5, 1) do |j| x.push(i) y.push(j) val = Math.sin(Math.sqrt(i*i+j*j))/Math.sqrt(i*i+j*j) fill.push((val.nan? ? 0 : val)) end end plot2 = Nyaplot::Plot.new hm = plot2.add(:heatmap, x, y, fill) hm.width(1) hm.height(1) plot2.legend(true) plot2.show colors = Nyaplot::Colors.GnBu hm.color(colors) plot2.show