Adding a trend line

Hi, im trying to add a trendline to my histogram. could someone please give me a hint or explain how to use the trend1d please. thanks
heres my code

gmt begin north

gmt trend1d north_mag.dat -Fxm >! trend.txt
gmt pshistogram -R0/9/0/5500 -JX6.5i/5i north_mag.dat -T0.1 -N -Bxa1f0.25+1 -Bya1000f500 -Gorange -W0.9 | gmt plot trend.txt -W2.5,red

gmt end show

Since -N draws a normal distribution, how can you be surprised? As for fitting a line to the histogram values you would need to dump those values out via -Io and then pipe that through either trend1d or gmtregress and then via plot the resulting model.

As for your trend1d effort, you are regressing individual points, not the peak of the histogram. All depends on what you need.

that makes sense haha, i misread the documentation. thank you for your help

im trying to fit a line to the histogram using the maximum likelihood estimate method