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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:20:54+00:00 2026-06-12T15:20:54+00:00

I need to plot a function on a coordinate system that has its origin

  • 0

I need to plot a function on a coordinate system that has its origin at the center of the screen (or somewhere near the center, but not necessarily in the center) and I need to draw axes so that they cross at the origin. Axes should have labels and tics as well, and arrows.

I have no idea how to do this efficiently, so far in my code I manually set offsets for my tics, and draw arrows manually using offsets as well. I also set offsets on the axes labels. All this is very fragile, and offsets change depending on the terminal settings.

Would someone please help me with a sample code or an explanation how to do this the right way?

  • 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-12T15:20:56+00:00Added an answer on June 12, 2026 at 3:20 pm

    Well, using _zeroaxis is the “right” way to go to get the tics and labels in: setting the _range gives you the symmetry to make 0,0 centre … and once you know the _range, you can draw arrows on manually.

    set xzeroaxis
    set xtics axis
    set xrange [-10:10]
    set arrow 1 from -9,0 to -10,0
    set arrow 2 from  9,0 to  10,0
    
    set yzeroaxis
    set ytics axis
    set yrange [-1:1]
    set arrow 3 from 0,-.9 to 0,-1
    set arrow 4 from 0,.9  to 0,1
    
    set border 0
    
    plot sin(x)
    

    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 need to plot some discrete predictions with probability intervals in ggplot2, but I'm
I need to plot a 2 argument function (so I need a 3D plot)
I need to get a plot that fits the data automatically using matplotlib. This
I am trying to plot roots of a function that is composed of multiple
I have several files with similar data that I need to plot using gnuplot.
I need to plot two data vectors with errorbars on one figure. errorbar() function
I have a somewhat complex plot task in matplotlib that requires--I think--an autoscale() function
I need to define an area in a plot(s) using the matplotlib function ginput().
I need plot a curve for my data , the source is like :
I need to plot multiple sphere and I was using the example code from

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.