Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8462379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:09:02+00:00 2026-06-10T14:09:02+00:00

This is the gnuplot commands from a shell script (from the Hannon Lab), and

  • 0

This is the gnuplot commands from a shell script (from the Hannon Lab), and I would like to port the plotting part to Ruby using the rgplot gem, but I fail getting the syntax right.

set boxwidth 0.75 absolute
set size 1,1
set style fill solid 1.00 border -1
set xlabel \"read position\"
set title \"Nucleotides distribution $TITLE\" 
set ylabel \"% of total (per read position)\" 
set key outside right top vertical Left reverse enhanced autotitles columnhead nobox
set key invert samplen 4 spacing 1 width 0 height 0 
set style histogram rowstacked 
set style data histograms 
set noytics
set xtics 1
set yrange [ 0.00000 : 100.000 ] noreverse nowriteback

plot '$FILENAME' using (100.*column(13)/column(18)):xtic(1) title \"A\" lt rgb \"#5050ff\", \
       '' using (100.*column(14)/column(18)) title \"C\" lt rgb \"#e00000\", \
       '' using (100.*column(15)/column(18)) title \"G\" lt rgb \"#00c000\", \
       '' using (100.*column(16)/column(18)) title \"T\" lt rgb \"#e6e600\", \
       '' using (100.*column(17)/column(18)) title \"N\" lt rgb \"pink\"
"

So far I have this:

Gnuplot.open do |gp|
  Gnuplot::Plot.new(gp) do |plot|
    plot.terminal options[:terminal]
    plot.title    options[:title]
    plot.xlabel   options[:xlabel]
    plot.ylabel   options[:ylabel]
    plot.output   options[:data_out] if options[:data_out]
    plot.boxwidth "0.75 absolute"
    plot.size     "1,1"
    plot.yrange   "[0:100]"
    plot.noytics
    plot.xtics    1
    plot.key      "outside right top vertical Left reverse enhanced autotitles columnhead nobox"
    plot.key      "invert samplen 4 spacing 1 width 0 height 0"
    plot.style    "fill solid 1.00 border -1"
    plot.style    "histogram rowstacked"
    plot.style    "data histograms"

    plot.data << Gnuplot::DataSet.new([x, a]) do |ds|
      ds.title = "A"
    end
  end
end

But I need help getting it right…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:09:03+00:00Added an answer on June 10, 2026 at 2:09 pm

    I finally got it together:

    Gnuplot.open do |gp|
      Gnuplot::Plot.new(gp) do |plot|
        plot.terminal options[:terminal]
        plot.title    options[:title]
        plot.xlabel   options[:xlabel]
        plot.ylabel   options[:ylabel]
        plot.output   options[:data_out] if options[:data_out]
        plot.ytics    "out"
        plot.xtics    "out"
        plot.yrange   "[0:100]"
        plot.xrange   "[0:#{max_len}]"
        plot.auto     "fix"
        plot.offsets  "1"
        plot.key      "outside right top vertical Left reverse enhanced autotitles columnhead nobox"
        plot.key      "invert samplen 4 spacing 1 width 0 height 0"
        plot.style    "fill solid 0.5 border"
        plot.style    "histogram rowstacked"
        plot.style    "data histograms"
        plot.boxwidth "0.75 absolute"
    
        plot.data << Gnuplot::DataSet.new(n) do |ds|
          ds.using = "1"
          ds.with  = "histogram lt rgb \"black\""
          ds.title = "N"
        end
    
        plot.data << Gnuplot::DataSet.new(g) do |ds|
          ds.using = "1"
          ds.with  = "histogram lt rgb \"yellow\""
          ds.title = "G"
        end
    
        plot.data << Gnuplot::DataSet.new(c) do |ds|
          ds.using = "1"
          ds.with  = "histogram lt rgb \"blue\""
          ds.title = "C"
        end
    
        plot.data << Gnuplot::DataSet.new(t) do |ds|
          ds.using = "1"
          ds.with  = "histogram lt rgb \"green\""
          ds.title = "T"
        end
    
        plot.data << Gnuplot::DataSet.new(a) do |ds|
          ds.using = "1"
          ds.with  = "histogram lt rgb \"red\""
          ds.title = "A"
        end
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a graph like this one using gnuplot (or matplotlib,
I'm plotting some data curves with gnuplot, and they look like this: However, the
I often plot graphs in gnuplot prompt shell, like this: gunuplot> plot sin(x) with
I'm using gnuplot from a bash script and I have to divide values from
this is my first question in here, and I would like to ask if
I found many solutions to this question for GNUPlot 4.2+ using title column, columheader
My input to gnuplot looks something like this: 1:00am 1 10 1:00am 30 12
I am making palette in gnuplot using commands: set pm3d implicit at b set
I am using an example program from this code http://sicktoolbox.sourceforge.net/ > http://sourceforge.net/projects/sicktoolbox/files/ . It's
I'm using the following gnuplot commands to create a plot: #!/bin/bash gnuplot << 'EOF'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.