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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:47:04+00:00 2026-06-09T16:47:04+00:00

I am plotting a 3d surface with gnuplot splot function. The data is written

  • 0

I am plotting a 3d surface with gnuplot “splot” function. The data is written in (x,y,z) format in 3 columns in a text file. When I plot the data from the file, splot connects the endpoints of the data. The surface itself is correct, but there is an additional unwanted set of parallel lines (forming an xy plane) at the bottom of the surface. So for each x, it plots a function decaying to zero symmetrically, but then +\infty and -\infty are connected together as well! That makes something like an unwanted x-axis below the graph.

I tried to set off boundaries to zero, playing with data format, etc. No luck!

  • 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-09T16:47:05+00:00Added an answer on June 9, 2026 at 4:47 pm

    Your problem is that your data isn’t in ‘grid data’ format. Gnuplot sees the data and plots it as lines instead of plotting it as a surface. Unfortunately, I don’t know matlab, but here’s some pseudo-code which should work (although may not be the most efficient way to write the data):

     do iy=1 to ny
        do ix=1 to nx
           write gridx(ix,iy), gridy(ix,iy), data(ix,iy)
        enddo
        write blank line
     enddo
    

    Of course, if your grids can be expressed as 1D arrays (instead of 2D as above), you can just do the following (with appropriate loops):

     write gridx(ix), gridy(iy), data(ix,iy)
    

    Alternatively, you can use dgrid3d in gnuplot. dgrid3d interpolates non-grid data into grid data. By default, it interpolates to a 10×10 grid which as you noted is pretty coarse. You can increase this by set dgrid3d NX,NY where NX and NY are the number of points on the x and y axes respectively.

    Finally, if you don’t want to mess with your datafile, you might want to consider using the following awk script from the gnuplot FAQ (section 3.9):

    #addblanks.awk
    /^[[:blank:]]*#/ {next} # ignore comments (lines starting with #)
    NF < 3 {next} # ignore lines which don't have at least 3 columns
    $1 != prev {printf "\n"; prev=$1} # print blank line
    {print} # print the line
    

    Now to plot your surface:

    set surface
    splot "<awk -f addblanks.awk yourdatafile.dat" 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am plotting boxplots from this data: MY_LABEL MY_REAL MY_CATEGORY 1 [POS] .56 POS
I'm plotting some data curves with gnuplot, and they look like this: However, the
when plotting my data using gnuplot, I experience that the right border is cut
I have created a MATLAB plotting with the plot() function. How do I change
When plotting a function using Plot, I would like to obtain the set of
I'm plotting data which extent, in x, from -1000 to 1000. But I'm only
I'm plotting a scatter plot with three columns: Green group: x y pointlabel 48,6
I am plotting data from an aircraft on a map and I would like
I am plotting data in a typical MATLAB scatterplot format. Ordinarily when plotting multiple
I'm plotting the figure below using R's plot() function. It is a plot of

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.