How to create a Histogram of Slope

126 views
Skip to first unread message

Les McElhaney

unread,
Jul 30, 2025, 5:36:21 PMJul 30
to golden-cheetah-users
Hi,

I would like to create a histogram chart for each activity with the x-axis being slope in % and the y-axis as time.

Thanks in advance,
Les

Ale Martinez

unread,
Jul 30, 2025, 6:40:35 PMJul 30
to golden-cheetah-users
There is no builtin chart for this, so your options are: User Chart, R Chart or Python Chart.

Ale Martinez

unread,
Jul 30, 2025, 7:50:15 PMJul 30
to golden-cheetah-users
Unless you are already familiar with R or Python my recommendations would be a User Chart, there is an aggregate function handy to create the histogram data explained in the wiki.

Ale Martinez

unread,
Jul 31, 2025, 9:55:15 AMJul 31
to golden-cheetah-users
Added this as an example chart since I think it can be illustrative of GC formulas expressiveness (great job, Mark!): https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Working-with-User-Charts#slope-histogram-example-chart 

Steve Edmonds

unread,
Jul 31, 2025, 5:59:54 PMJul 31
to golden-che...@googlegroups.com
That is very elegant and shows what can be done with good understanding (and reading the Wiki).

A few years ago I was interested in analysing upcoming rides (from others ride data posted on RWGPS) for % of distance within slope bands to target my amount of hill training so created a basic less elegant bar chart with specific bands of interest. Not what the OP wanted (% of time at slope) but possibly of interest.

I also found it useful at times to run Edit>Fix GPS Errors.... if slope data varied unrealistically, frequent in areas of poor GPS reception.

{

finalise {

# we just fetch samples at end

sp <- samples(SPEED);

sl <- samples(SLOPE);

yy <- 100 * c(

sum(sp[sl[i]<=-15.0]),

sum(sp[sl[i]>-15.0 && sl[i]< -10.0]),

sum(sp[sl[i]>-10.0 && sl[i]< -5.0]),

sum(sp[sl[i]>-5.0 && sl[i]< -0.5]),

sum(sp[sl[i]>-0.5 && sl[i]<0.5]),

sum(sp[sl[i]>0.5 && sl[i]<5.0]),

sum(sp[sl[i]>5.0 && sl[i]<10.0]),

sum(sp[sl[i]>10.0 && sl[i]<15.0]),

sum(sp[sl[i]>=15.0])

)/sum(sp);

xx <- c("down lt -15","down -15~-10","down -10~-5","down -5~-0.5","flat","up 0.5~5","up 5~10","up 10~15","up>15");

}

x { xx; }

y { yy; }

}


Steve

On 01/08/2025 01:55, Ale Martinez wrote:
Added this as an example chart since I think it can be illustrative of GC formulas expressiveness (great job, Mark!): https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Working-with-User-Charts#slope-histogram-example-chart  --
_______________________________________________
Golden-Cheetah-Users mailing list
golden-che...@googlegroups.com
http://groups.google.com/group/golden-cheetah-users?hl=en
---
You received this message because you are subscribed to the Google Groups "golden-cheetah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golden-cheetah-u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golden-cheetah-users/5e1e18f4-4b44-4c9e-ab0f-ab92f7bd3921n%40googlegroups.com.

Ale Martinez

unread,
Aug 9, 2025, 11:34:09 AMAug 9
to golden-cheetah-users
El jueves, 31 de julio de 2025 a la(s) 6:59:54 p.m. UTC-3, st...@edmondsfamily.co.nz escribió:
That is very elegant and shows what can be done with good understanding (and reading the Wiki).

A few years ago I was interested in analysing upcoming rides (from others ride data posted on RWGPS) for % of distance within slope bands to target my amount of hill training so created a basic less elegant bar chart with specific bands of interest. Not what the OP wanted (% of time at slope) but possibly of interest.

Accumulating time is a special case since count can be used over the slope vector, but the same logic can be used with distance (or work, heart beats, etc.), all you need is to use multisort to keep the vectors aligned before to accumulate.
Reply all
Reply to author
Forward
0 new messages