Page 1 of 1

Categorical graphs - bug in ordering of within categories

Posted: Thu Jul 02, 2020 7:43 am
by mamo
Dear EVEIWS team

It seems that the ordering of within-categories in categorical graphs is not properly reflected, neither when the graph is programed nor when the ordering of the graph is changed via the options menu - see example program below

Best, mamo

Code: Select all

wfcreate a 2010 2011 rndseed 42 series x=nrnd series y=nrnd series cat=nrnd>0 group gr x y ' The graph gra_catyear should present output as ordered by "cat" first, then "@year" freeze(mode=overwrite,gra_catyear) gr.bar(elemcommon=1) across(@SERIES,cscale) within(cat) within(@year) ' The graph gra_yearcar should present output as ordered by "@year" first, then "cat" freeze(mode=overwrite,gra_yearcat) gr.bar(elemcommon=1) across(@SERIES,cscale) within(@year) within(cat) show gra_catyear show gra_yearcat ' But both graphs present the same orderings, of "cat" first, then @year ' Manually changing the ordering in the options menu of the graph generated in the line below neither seems to work gr.bar(elemcommon=1) across(@SERIES,cscale) within(@year) within(cat)

Re: Categorical graphs - bug in ordering of within categories

Posted: Thu Jul 02, 2020 8:12 am
by mamo
As I have found, the bug in the ordering of categories seems to be related to the dated workfile covering only two periods.
The categorical ordering works as expected in the code below which defines a three-year-range of the annual workfile (2009-2010).

Best, mamo

Code: Select all

wfcreate a 2009 2011 rndseed 42 series x=nrnd series y=nrnd series cat=nrnd>0 group gr x y ' The graph gra_catyear should present output as ordered by "cat" first, then "@year" freeze(mode=overwrite,gra_catyear) gr.bar(elemcommon=1) across(@SERIES,cscale) within(cat) within(@year) ' The graph gra_yearcar should present output as ordered by "@year" first, then "cat" freeze(mode=overwrite,gra_yearcat) gr.bar(elemcommon=1) across(@SERIES,cscale) within(@year) within(cat) show gra_catyear show gra_yearcat ' But both graphs present the same orderings, of "cat" first, then @year ' Manually changing the ordering in the options menu of the graph generated in the line below neither seems to work gr.bar(elemcommon=1) across(@SERIES,cscale) within(@year) within(cat)