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 3963644
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:14:24+00:00 2026-05-20T03:14:24+00:00

I am new to gnuplot, and am trying to create a stacked histogram for

  • 0

I am new to gnuplot, and am trying to create a stacked histogram for a project. The problem I am running into is, that I am not able to put ticlabels on the x-axis (even if I could, they are not getting formatted in a neat way). My gp file is as follows:

Here is a snapshot of my data file:

CC P1-X P1-Y P2-X P2-Y
1 0.1097586  0.3262812  1.980848  5.9098402
2 0.1010986  0.2988812  0.9966702  5.8378412
3 0.4017474  0.7559452  4.41813  11.7404132
4 0.1028442  0.2974772  1.418744  6.0554552
5 0.1097316  0.3216112  1.967492  5.8007364
6 0.954794  0.3004874  0.9568386  5.778537

And here is my gp file:

set title "GCC compilation option by average execution time as stacked histogram"
set terminal jpeg medium
set output "histosmalldata.jpeg"
set boxwidth 0.9 absolute
set style fill solid 1.00 border -1
set key autotitle columnheader
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 title  offset character 0, 0, 0
set style data histograms
set xtics border in scale 1,0.5 nomirror rotate by -45  offset character 0, 0, 0
set xtics norangelimit
set xtics ("O2-ffast-math-finline-functions" 1, "O2-funroll-loops-march=barcelona-ffast-math-finline-functions" 2, "GCCFLAGS_O0" 3, "O2-ftree-vectorize-funroll-loops-march=barcelona" 4, "GCCFLAGS_O2" 5, "O2-ftree-vectorize-funroll-loops-ffast-math" 6)
set xtics 1,6 nomirror 
set ytics 0,100 nomirror
set ytics 1
set yrange [0:20]
set ylabel "Time"
set xlabel "GCC Compiler Options"
plot 'smalldata' using 2:xtic(1) ti col, '' using 3 ti col, '' using 4 ti col, '' using 5 ti col

This is the image of the graph:
enter image description here

Now, in the x axis, I am having 1,2,3 – 6 which I don’t want, instead, I would want “O2-ffast-math-finline-functions” for 1 and so on in a neat formatted way.

I wrote this script after consulting some examples from gnuplot page and do not have a good understanding of some of the verbs, so apart from the solution, any general comments are welcome.

Thank you,
Sayan

  • 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-05-20T03:14:24+00:00Added an answer on May 20, 2026 at 3:14 am

    You should not overwrite your xtics settings after you specified what you want.

    Put all options into a single set command:

    set xtics border in scale 1,0.5 nomirror rotate by -45  offset character 0, 0, 0\
             norangelimit\
             ("O2-ffast-math-finline-functions" 1,\
              "O2-funroll-loops-march=barcelona-ffast-math-finline-functions" 2,\
              "GCCFLAGS_O0" 3, "O2-ftree-vectorize-funroll-loops-march=barcelona" 4,\
              "GCCFLAGS_O2" 5, "O2-ftree-vectorize-funroll-loops-ffast-math" 6)
    

    Note that you can escape the newline with a backslash as the last character of the line.

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

Sidebar

Related Questions

I am completely new to gnuplot and am only trying this because I need
New to Linux programming in general. I am trying to communicate with a kernel
New to Maven. Ok so I used Maven to package up my project, but
New to php and drupal. I set up drupal and trying to customize the
New guy here so bear with me. Ive got a basic XSL file that
new to cakePHP and trying my first join. I've got one table called users
New to the MVC.net scene (and .net for that matter), but seems I find
New to StackOverflow and new to C. I'm trying to take a struct as
I have a new web app that is packaged as a WAR as part
I'm trying to build a Chrome browser extension, that should enhance the way the

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.