Data visualization with SAS programming

WARNING: Order value specified in the AXIS statement does not match a midpoint value.

Reply
Super User
Posts: 980

WARNING: Order value specified in the AXIS statement does not match a midpoint value.

Hi Experts,

I am trying to generate the bar chart by using the below code in sas 9.2 version.

data have;

  input disease$ days treat grade;

cards;

fever 4 2 2

fever 1 2 1

;

   

legend1 across=1 mode=protect position=(TOP RIGHT OUTSIDE) ;

axis1 label=("Count" ) order=(0 to 4 by 1) minor=none;

axis2 label=("Treatment") order=(1,2) minor=none ;

axis3 label=( "Days") order=(1 to 7 by 1) minor=none ;

proc gchart data=have;

by disease;

   vbar treat / group=days  subgroup=grade midpoints=(1 2 )  raxis=axis1

maxis=axis2

gaxis=axis3 discrete  space=0.5 noframe legend=legend1 width=2.5;

run;

quit;

The problem here is i am getting a

WARNING: Order value specified in the AXIS statement does not match a midpoint value.

This is related to the gaxis=axis3, as i want to display the dummy days as well. so could you  please suggest required changes to the code and avoid the warning.

Thanks,

Jag

Thanks,
Jag
SAS Super FREQ
Posts: 863

Re: WARNING: Order value specified in the AXIS statement does not match a midpoint value.

I believe the warning is not coming from the ORDER on the axis3 statement (the group axis), but from the ORDER on the axis2 statement (midpoint axis). I think if you just remove the ORDER from that statement, the MIDPOINT option on the VBAR statement will give you what you want. Let me know if that does not work for you. Thanks!

Super User
Posts: 980

Re: WARNING: Order value specified in the AXIS statement does not match a midpoint value.

Per your suggestion i tried the following but still the warning is coming

legend1 across=1 mode=protect position=(TOP RIGHT OUTSIDE) ;

axis1 label=("Count" ) order=(0 to 4 by 1) minor=none;

axis2 label=("Treatment") minor=none ;

axis3 label=( "Days") order=(1 to 7 by 1) minor=none ; 

proc gchart data=have;

by disease;

   vbar treat / group=days  subgroup=grade midpoints=(1 2 )  raxis=axis1

maxis=axis2

gaxis=axis3 lref=0 cref=cyan wref=5 discrete  space=0.5 noframe legend=legend1 width=2.5;

run;

quit;

Thanks,
Jag
Super User
Posts: 980

Re: WARNING: Order value specified in the AXIS statement does not match a midpoint value.

Hi Dan,

Could you please let me know if there is any alternative approach.

Thanks,

Jag

Thanks,
Jag
Post a Question
Discussion Stats
  • 3 replies
  • 496 views
  • 0 likes
  • 2 in conversation