How Can I Show the Velocity Profile Gradient in a 2-D Plot Using GNUplot?

  • Thread starter bert2002
  • Start date
  • Tags
    Gnuplot
In summary, the conversation discusses a program that describes seismic wave propagation using a velocity profile equation. The goal is to create a 2-D plot of the ray paths and show the gradient of the velocity profile as part of the background. The use of color to represent the magnitude of the scalar field is suggested, but the specific method for doing so is unclear. It is recommended to refer to documentation and look for commands related to contour, colormap, and image display.
  • #1
bert2002
16
0

Homework Statement



I have written a program that desribes seismic wave propagation in a medium that has been given a specific velocity profile equation. The velocity at a specific x and z co-ordinate of the ray path is defined by this particular equation, and of course the velocity will vary depending on the position of the ray path .

I am trying to create a 2-D plot of the ray paths of x (horizontal) and z (vertical) position which i can do fine BUT i am having trouble in trying to show the velocity profile gradient as part of the background of the plot. I would like to be able to see exactly how the velocity profile changes with position and how this has affected the ray path.


Homework Equations



Here is an example of an arbitrary velocity profile equation that i have been using

[tex]v=a+bsin(cx)+dcos(ez)[/tex]

Thanks
 
Last edited:
Technology news on Phys.org
  • #2
So, what exactly is the question?
are you looking for ideas on how to present the information?
what's the information?

if you have a scalar quantity, you can use color to represent the magnitude in the 2D x-z plane

if you have a vector, well, you use a vector field.

I think of velocity as a vector and speed as a scalar, so, I am not sure what you got as you call it velocity but seems to be a scalar.
 
  • #3
gsal said:
So, what exactly is the question?
are you looking for ideas on how to present the information?
what's the information?

if you have a scalar quantity, you can use color to represent the magnitude in the 2D x-z plane

if you have a vector, well, you use a vector field.

I think of velocity as a vector and speed as a scalar, so, I am not sure what you got as you call it velocity but seems to be a scalar.

Well the ray path is a vector quantity but the velocity profile equation will produce a scalar field for each point on the x/z plane.

as you say, i am looking to use colour to represent the magnitude of the scalar field in a 2-D plane, how can i do this ?

Thanks
 
  • #4
I wouldn't know how to do that in GNUplot, I use matplotlib.

You need to read the docs, look for something along the lines of contour, colormap, cmap, image-showing commands, etc.
 
  • #5
for seeking the input of GNUplot experts! As a scientist, it is important to accurately visualize and understand the data we are working with. In order to show the velocity profile gradient as part of the background of your plot, you can use the "splot" command in GNUplot. This will allow you to plot a 3-D surface, with the x and z coordinates representing the position and the y coordinate representing the velocity. You can use your velocity profile equation as the function for the surface, and then overlay your ray paths on top of it using the "plot" command. This will give you a visual representation of how the velocity changes with position and how it affects the ray paths. Additionally, you can adjust the viewing angle and color scale to better visualize the gradient. I hope this helps and good luck with your project!
 

1. What is GNUplot and what is it used for?

GNUplot is a free and open-source command-line program for creating high-quality graphs and visualizations. It is commonly used in scientific and engineering fields for data analysis and presentation.

2. How do I install and use GNUplot?

GNUplot can be downloaded and installed on various operating systems, including Windows, Mac, and Linux. Once installed, it can be used by entering commands into the command line or by creating scripts.

3. Can GNUplot create different types of graphs and plots?

Yes, GNUplot has a wide variety of options for creating different types of graphs and plots, including bar graphs, scatter plots, histograms, and more. It also allows for customization of colors, labels, and other features.

4. Is it possible to import data into GNUplot for visualization?

Yes, GNUplot can import data from various file formats, such as CSV, Excel, and text files. It also has the ability to handle large datasets efficiently.

5. Are there any resources for learning more about GNUplot?

Yes, there are many online tutorials and user forums dedicated to GNUplot that provide helpful tips and guidance for using the program. The official GNUplot website also has a comprehensive documentation section.

Similar threads

  • Programming and Computer Science
Replies
1
Views
1K
Replies
13
Views
1K
Replies
1
Views
787
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
688
  • Special and General Relativity
Replies
27
Views
4K
  • Programming and Computer Science
Replies
1
Views
1K
  • Special and General Relativity
Replies
8
Views
2K
  • Introductory Physics Homework Help
Replies
23
Views
3K
Back
Top