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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:54:53+00:00 2026-06-04T20:54:53+00:00

I am trying to create a stacked histogram with the following data: 8.01 1

  • 0

I am trying to create a stacked histogram with the following data:

8.01    1   5   1   
8.02    3   5   1
8.03    4   4   1
8.04    3   4   1
8.05    1   2   1

I have tried to adapt the script from the 4th example and at the moment I’m using this:

set title "Test"
set key invert reverse Left outside
set key autotitle columnheader
set style data histogram
set style histogram rowstacked
set style fill solid border -1
set boxwidth 0.75

plot 'test.dat' using 2:xtic(1),  '' using 2 title 'Col1', '' using 3 title 'Col2', '' using 4 title 'Col3'

The part I copied which I’m not sure about is using 2:xtic(1). I know this makes it use the xtic values as the first column, which is what I want. But I don’t know what the using 2 part represents. This is a screenshot of what the script produces:

enter image description here

Everything is fine on the image except the red bar which should not be there. Could someone explain to me why it is appearing and how to get rid of it?

  • 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-04T20:54:54+00:00Added an answer on June 4, 2026 at 8:54 pm

    using 2 means that gnuplot will use the 2nd column from the file for the data it is plotting. If you are plotting x data vs. y data, the command is plot data using 1:2 if x data is in column 1 and y data is in column 2. plot using 2 will plot the data from column 2 on the y axis, and for each data point the x coordinate will be incremented by 1.

    You’ll notice that the green and red bars are the same size: they both use column 2. If you don’t want the first (red) bar to appear, you could change the plot command to

    plot 'test.dat' using 2:xtic(1) title 'Col1', '' using 3 title 'Col2', '' using 4 title 'Col3'
    

    With this command, the xtic labels will stay the same, and the first bar will no longer be there. Note that the colors for the data will change with this command, since the first thing plotted will be red, the second green and the third blue.

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

Sidebar

Related Questions

Hello I am trying to create a stacked barplot using the following code: test
I am trying create a data.frame from which to create a graph. I have
Ok so I am trying create a login script, here I am using PHP5
I am new to gnuplot, and am trying to create a stacked histogram for
I'm trying to create a horizontal 100% stacked bar graph using HTML and CSS.
I'm trying to create a stacked bar graph with errorbars* using ggplot2, similar to
I am trying to create a UIAlertView with three buttons (which will be stacked).
I'm trying create a gui using Tkinter that grabs a username and password and
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Trying to create a prayer time app for prayertimes in Oslo. I have a

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.