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

  • SEARCH
  • Home
  • 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 8026443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:29:28+00:00 2026-06-04T23:29:28+00:00

I am using gnuplot to generate graphs for multiple benchmarks. For each benchmark I

  • 0

I am using gnuplot to generate graphs for multiple benchmarks.

For each benchmark I have many configurations to plot.
I want to plot a graph hit-rate(my y-axis) vs benchmark(x-axis).
There will be multiple columns for each benchmark differentiated by their color.

I generated the same type of graphs some time back using some python script, but I don’t know how to do this in gnuplot.

  • 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-04T23:29:30+00:00Added an answer on June 4, 2026 at 11:29 pm

    This raw data, languages.data:

    Title   C   C++ Java    Python
    "Writing code"  6   4   10  1
    "Understanding code"    6   3   4   1
    "Generating prime numbers"  3   1   2   10
    

    With this code:

    set title "Benchmarks"
    C = "#99ffff"; Cpp = "#4671d5"; Java = "#ff0000"; Python = "#f36e00"
    set auto x
    set yrange [0:10]
    set style data histogram
    set style histogram cluster gap 1
    set style fill solid border -1
    set boxwidth 0.9
    set xtic scale 0
    # 2, 3, 4, 5 are the indexes of the columns; 'fc' stands for 'fillcolor'
    plot 'languages.data' using 2:xtic(1) ti col fc rgb C, '' u 3 ti col fc rgb Cpp, '' u 4 ti col fc rgb Java, '' u 5 ti col fc rgb Python
    

    Provides the following histogram:

    gnuplot histogram

    But I would suggest using R of which syntax is way more readable:

    library(ggplot2)
    # header = TRUE ignores the first line, check.names = FALSE allows '+' in 'C++'
    benchmark <- read.table("../Desktop/gnuplot/histogram.dat", header = TRUE, row.names = "Title", check.names = FALSE)
    # 't()' is matrix tranposition, 'beside = TRUE' separates the benchmarks, 'heat' provides nice colors
    barplot(t(as.matrix(benchmark)), beside = TRUE, col = heat.colors(4))
    # 'cex' stands for 'character expansion', 'bty' for 'box type' (we don't want borders)
    legend("topleft", names(benchmark), cex = 0.9, bty = "n", fill = heat.colors(4))
    

    Furthermore it provides a slightly prettier output:

    R histogram

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to plot multiple rowstacked histograms on the same graph using gnuplot. A
I am trying to plot a graph using gnuplot. I have six text files.
I have an automated script that generates a graph every day using GNUPlot. The
I'm using C++ to plot graphs using Gnuplot. In the C++ program, I popen()
I'm trying to plot a graph in real time using GNUplot and C++. Does
I want a radial(polar) plot using gnuplot (i.e in circular co-ordinate system(r,theta). Here I
I have to plot an histogram in logarithmic scale on both axis using gnuplot.
I found many solutions to this question for GNUPlot 4.2+ using title column, columheader
I have been using gnuplot for some time now and set terminal pdfcairo set
I'm using Gnuplot to draw a graph. In the graph I drew three smooth

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.