Hi everyone! I am trying to plot some data using the command gmt plot but I’m having some issues.
Original data have a .001 file extension and I processed them (I removed some columns) in order to obtain a .csv file. In the end, I exported as .txt file but when I am running the .bat file there are not data visualized. Also, there isn’t any error or warning message while the script runs, it just does not display data. Can anyone help me? I have tried many ways but none it seems to work. Thank you a lot for you help !
The script is:
gmt begin file1 png
gmt plot filepath\filename.txt -R-800000/0/-4/0 -JX15c/10c -Baf
gmt end show
pause
Hi Andreas, thank you for your answer and sorry for the lack of information I gave you.
These are the first lines of the original data file (a .001 file named obs.data.001) I collected. I need to plot the 4th column (-797099.00000, etc.) on the x -axis and the 5th on the y-axis.
I moved the content of the file in an excel environment and I have converted it in a csv file, keeping just the 4th and the 5th column as shown in the figure below:
Okay I found out the problem. As you said, it was wrong the -R range. My aim was to plot two datasets with very different interval and I didn’t remember to change -R. So a last question: is it possible to plot a graph with two y-axis? Thank you very much for your help. I am new in using these tools and I made a very naive mistake.
A general tip when dealing with files with multiple columns is to first make sure that the correct columns are passed to/used by gmt. Check this with e.g, gmt info <file> too see what gmtsees. And adjust -R as needed.
When I have made plots with different y-axis, (I think) a good way is to use a common -J, but different -R. Then use -BWeSn for the first dataset and -BwEsN for the second.