The results of the psxy plot are not precise

My psxy plot give plotted data like a grid point, even though the input data is more than 4 decimal precision. Anyone can help to fix this?

I’ve used default format:

My system

  • Operating system: Windows 10 64-bit
  • GMT version ( gmt --version ): 5.4.5
  • Ghostscript: 9.50

You can add plots to the post just by drag-n-drop the figure. But there is nothing wrong with the plot. You are just seeing what data has to tell. Try with some other software and you’ll get the same. For example, below is high zoom in Mirone.

Below is the plot of the data before I projected to the z-axis on this script using 2 difference mapping tools. I fell like gmt rounding the decimal, so it’s show grid-like trend.

take look at my circle, some data that has small coordinate differences overlapping with each other on gmt plot when compared to other plot.

@Yehezkiel could you please share your plotting script?

So GMT does no such rounding unless it is being told to. In the past, such cases have been tracked down to the user’s FORMAT_GEO_OUT but I see you are setting that so not sure. All I can tell you is that we have no internal rounding of any coordinates, obviously. I guess we don’t know exactly what you do in your projection to the z-axis; could that step mess things up?

this is the core script @leouieda :

set data=data.txt

pscoast -JM8c -R127.38/129.38/-4.53/-2.53 -Dh -B1::WSne -G245/245/200 -S150/255/255 -W0.2p,black -K > %ps%
gawk -F" " “{print $6,$7}” %data% | psxy -R -JM -Sc0.04 -Gred -W0.2 -O >> %ps%

the data.txt you can get here

I don’t think so @pwessel, because the straight plot also show same things before projection. Can it caused by bugs on this version of the gmt or ghostscript? I see this thing when reinstalling my system and change to GMT 5.4 and GS 9.27.

Well, if you examine your data you will see it has 2 decimals, e.g., 128.21 -03.59. If you add g0.01 to your -B option you will see the data line up perfectly with those 0.01 degree gridlines. Your data is simply only accurate in position to the nearest 0.01 degree.

Thank you @pwessel, for this, the problem maybe just the size of the symbol?

how about the projection with the script:
set data=data.txt
gawk -F" " “{print $6,$7,$8,$9,$10}” %data% | project -C128.38/-3.53 -A180 -Fxyzpqrs -Q > proyeksi.dat
psbasemap -JX8/3.5 -R-40/40/-50/0 -Bxa20g1+l"Distance (km)" -Bya20f20+l"Depth (km)" -BWSne+t"Cross Section" --MAP_ANNOT_MIN_SPACING=0.1p --FONT_ANNOT_PRIMARY=8 --FONT_LABEL=9 --FONT_TITLE=10 -K > %ps%
gawk -F" " “{print $7,$3*(-1.0)}” proyeksi.dat | psxy -R -J -Sc0.08 -Gred -W0.2 -O >> %ps%

the projection result is in >9 decimal but plot show like this:

If your data are quantized spatially (0.01 resolution) then I would expect any projection onto a line to retain part of that regularization. I can guarantee you there is absolutely no rounding whatsoever in psxy, so if things line up it is because they are already quantized. The symbol size does not affect anything related to placement. The default output format for floats is %.12g so plenty of resolution if the data have it.

Thanks for your explanation @pwessel. But on the script above, I have projected the data to “km” unit then plot in -JX projection using distance and I see the projected data (x column) have enough resolution. Can you help me, if there is something wrong on my projection script above?

There is nothing wrong and everything looks like I expected. With an azimuth of 180 you are doing a crossection that is north/south so you are seeing the quantizing of latitude at 0.01 degree or ~1.13 km.

Thanks for your help @Joaquim, @pwessel . I rechecked, it is my reformat data-script outside gmt that decimate the data to 2 decimal, so it make me the difference plot on gmt with the others which use data before reformat. I’m so sorry to make you all confuse.