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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:13:07+00:00 2026-05-27T11:13:07+00:00

I would like to create a graph like this one using gnuplot (or matplotlib,

  • 0

I would like to create a graph like this one using gnuplot (or matplotlib, if need be), but I don’t know if/how it can be done:

rough outline of what the graph should look like

This, of course, is just a rough sketch. What is important is that I need to plot pairs of values (in this example, each pair consists of a red and a blue dot). One item from each pair is a single value, the other one is supposed to show a range of values (my idea was to plot the mean value with error bars to indicate the range’s max and min, but I’m open to better ideas). The x-axis has no purpose other than giving the names of the various categories–all that matters are the y-values.

I am pretty sure I could create something like this (value pairs and x-categories) using histograms, but boxes just strike me as wrong in this case.

What I have got so far: I have this gnuplot command:

plot 'TEST.out' using 0:2:3:xticlabel(1) w errorbars pt 7 notitle

Used with this data file (category name, y-value, error bar value):

cat1 15 0
cat1 18 3
cat2 13 0
cat2 10 4

it yields below plot, which goes in the right direction, but which is not yet ideal (all data points have the same colour, and for the single values you can still see that error bars were used; also the grouping isn’t very nice–if the two points making up one pair were closer to each other that would make the plot easier on the eye).

where I have got so far

If anyone has any suggestions (even for creating a graph that does not look exactly like the example I gave in the beginning). I would be very grateful.

Thanks a lot for your time!

  • 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-27T11:13:07+00:00Added an answer on May 27, 2026 at 11:13 am

    In Matplotlib, you can set ticks individually. The method is explained in one of Matplotlib’s examples.

    Here is a start:

    # Initializations:
    from matplotlib import pyplot as pp
    import numpy as np
    
    pp.ion()  # "Interactive mode on": pyplot.* commands draw immediately
    
    # Data:
    series_red_y = [1.3, 1.4, 2.2]
    series_blue_y = [1.6, 1.8, 1.8]
    series_blue_err = [0.25, 0.25, 0.5]
    names = ('Category 1', 'Category 2', 'Category 3')
    
    # Where on the x-axis the data will go:    
    series_red_x = np.arange(0, 3*len(series_red_y), 3)  # Step of 3: red dot, blue dot, empty space
    series_blue_x = np.arange(1, 3*len(series_blue_y)+1, 3)  # Step of 3: red dot, blue dot, empty space
    
    # Plotting:
    pp.scatter(series_red_x, series_red_y, c='r', s=100)
    pp.scatter(series_blue_x, series_blue_y, s=100)
    pp.errorbar(series_blue_x, series_blue_y, yerr=series_blue_err, fmt=None,
                capsize=0)
    pp.xticks((series_red_x+series_blue_x)/2., names)
    
    # We wait until the user is ready to close the program:
    raw_input('Press enter...')
    

    Here is the result, which you can customize to your specific needs:

    enter image description here

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

Sidebar

Related Questions

I would like to dynamically create a minimal transparent bar graph to display over
would like to create a function that generates graphs using ggplot. For the sake
I would like to post data to a Facebook Page using Graph API even
I would like create my own collection that has all the attributes of python
I would like create a web service in ASP.Net 2.0 that will supports JSON.
Would like to create a strong password in C++. Any suggestions? I assume it
I would like to create a database backed interactive AJAX webapp which has a
I would like to create an SSL connection for generic TCP communication. I think
I would like to create a file format for my app like Quake, OO,
I would like to create a stored procedure in MySQL that took a list

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.