Histogram with y-range not specified

I am trying to make an histogram following the last example of the man page where the y-range is not specified.

gmt histogram errors.xy -T1 -R-10/10/0/0 -Jxc/0.01c -Bx2+lError -By100+lCounts -Gblack -i1 -V -pdf plot

I try it and a lot of different variations (with different data and ranges) but I can’t. It always complain about the -R values. What am I doing wrong?

Well, the man page is missing stuff in -J: It says it wil use 0.75cm/m but nothing is specified. So at least it should be -Jx0.75c/0.01c. But the whole example is fantasy, there were never such a data file, and this command was never actually run.
If you leave off -R entirely and do a proper modern command (not the 1-liner) then it may work.

Ok. Thanks Paul.

I saw the #4863. So I understand that now (in 6.2 dev) the following should work?

gmt begin Histo png
gmt histogram @v3206_06.txt -T100 -Jx0.002c/1c -Bxaf -By1 -Gblack -Z1 -R-6000/0/0/0
gmt end show

Or should I use this?

gmt begin Histo png
gmt histogram @v3206_06.txt -I -T100 -Z1 > q.txt
Max=$(gmt info q.txt -C -i3 -o1 -I2)
gmt histogram @v3206_06.txt -T100 -JX10/5c -Bxaf -Bya1f -Gblack -Z1 -R-6000/0/0/$Max
gmt end show

You could use either I think. If the first one works for you then it will be faster, while the second gives you more options. Let us know if there are ahy other issues!

With the first option I get this error:

histogram [ERROR]: Option -R parsing failure. Correct syntax:
	  Append +r if giving lower left and upper right coordinates
	-Rg or -Rd for global domain
	-R<grdfile> to take the domain from a grid file
histogram [ERROR]: Offending option -R-6000/0/0/0

I get the same as you. Worked for a case like in the documentation but I did not test much. Will have a look. Works without -R.

Thanks Paul. Now it works.

Just an idea that maybe could be add and maybe it is not difficult to implement. I don’t really need it.

Let that this could also work with a log scale.

gmt begin Histo png
gmt histogram @v3206_06.txt -T100 -Jx0.002c/1c**l** -Bxaf -By1 -Gblack -Z1 -R-6000/0/0/0
gmt end show

Now I get:

histogram [INFORMATION]: Use w/e/s/n = -6000/0/0/11 and x-tick/y-tick = 0/1
histogram [ERROR]: Option -JX|x:  Limits must be positive for log10 option
histogram [ERROR]: General map projection error