gmt icon indicating copy to clipboard operation
gmt copied to clipboard

Let -Ra works for log graph.

Open Esteban82 opened this issue 3 years ago • 3 comments

If I use -Ra I could get values that are not compatible for a logarithmic graph as in the example below.

gmt begin test png
	gmt math -T0/10240/1 T 10240 DIV 360 MUL 400 MUL COSD = t.txt
	gmt spectrum1d t.txt -S256  -W --GMT_FFT=brenner -N -i1    > pow5.txt 
	gmt plot pow5.txt -Wgreen -Re -JX-15cl/4c  -Bxa2f3 -Bya -Vi
	gmt plot pow5.txt -Wgreen -Ra -JX-15cl/4c  -Bxa2f3 -Bya -Vi -Yh+1c
gmt end #show
rm t.txt pow5.txt

For the -Re I got -R2/256/1.44309083861e-16/85.3334737947. For the -Ra I got -R0/260/-2/86 which is not compatible with a log graph.

I don't think it is very important and I don't need it (for now).

Esteban82 avatar Apr 22 '22 12:04 Esteban82

I see. There are two problems:

  1. This all happens before we parse common options so we would have to check the -J option string and figure out it is -Jx or -JX and if there is a trailing l and if there are slashes to indicate log10 for only one dimension. Not too hard.
  2. Assuming we know we are dealing with a log10 axis, we need to replace the current "find a reasonable lower and higher value" with something based on powers of 10, probably.

PaulWessel avatar Apr 29 '22 20:04 PaulWessel

Ok. I see.

What if we add a modifier (-Ra+l) to indicate that we will work with log data. I think it will easier.

Esteban82 avatar Apr 29 '22 20:04 Esteban82

Sort of defeats the purpose of saving the user from making decisions. I think I can fix this so it works well (soon)

PaulWessel avatar Apr 29 '22 20:04 PaulWessel