Data visualization with SAS programming

Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

Dear community,

I was wondering if someone could give me a hint regarding how to avoid scientifc notation on the y-axis in semi-log plots (Y log | X linear)? The Y axis has a range from 10 000 - 1 000 000 wherase the data ranges from 20.000-500.000. SAS turns the range on the y axis into 1E5 - 1E6 which I would like to avoid. I am using GTL/sgrender and this is my standard logopts statement:

logopts=(base=10 tickintervalstyle=LOGEXPAND minorticks=TRUE THRESHOLDMAX=0.35 THRESHOLDMIN=0.35))

I have tried the following:

- in logopts: viewmax=/viewmin= | logopts seems to ignore that)

- applying a format (TICKVALUEFORMAT=yleft_fmtname) which does not work in logopts

Any ideas what to try more?

Thanks for your help!

Andreas

I got SAS 9.3



Accepted Solutions
Solution
‎02-27-2015 03:43 AM
PROC Star
Posts: 1,672

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

Why not just add a format statement?

proc sgrender data=testdata template=testapp;

  format y comma10.0;

run;

View solution in original post


All Replies
Super Contributor
Posts: 252

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

Hello Andreas,

The code you have shown, seems like it should work, i.e. because you are using base = 10 and tickintervalstyle = LOGEXPAND.

Can you provide your full program and the dataset so I can have a more detailed look. There may be another reason why it's not working as you expect.

Thanks.

Occasional Contributor
Posts: 7

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

Dear djrisks,

When I am exectuing the attached sampleprogram, I have the following options:

1.) comment viewmax out -> y-axis ranges from 1E4-1E6 where I would rather like to have 10,000 - 1,000,000

2.) comment thresholdmin and thresholdmax out and use viewmax -> y-axis marks range form  10,000 - 100,000 where I would rather like to have either the above or 10,000 - 500,000

Thanks for your help.

Attachment
Solution
‎02-27-2015 03:43 AM
PROC Star
Posts: 1,672

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

Why not just add a format statement?

proc sgrender data=testdata template=testapp;

  format y comma10.0;

run;

Occasional Contributor
Posts: 7

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

Thanks Chris,

Was too focued on getting it done with "tickvalueformat=".

PROC Star
Posts: 1,672

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

No worries. It'd be interesting to know why  tickvalueformat  didn't work though.

Occasional Contributor
Posts: 7

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

I think it does not exist for logopts but only for linearopts.

PROC Star
Posts: 1,672

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

There are still too many inconsistencies.    :-(

Super Contributor
Posts: 252

Re: Avoiding scientific notation|apply format on LOG axis - GTL/sgrender

Hi Andreas,

Thank you for supplying the code. I agree with Chris's answer. Using the format statement along with your template and dataset produces your desired result.

Thanks.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 718 views
  • 0 likes
  • 3 in conversation