BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
adqs
Calcite | Level 5

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


1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Why not just add a format statement?

proc sgrender data=testdata template=testapp;

  format y comma10.0;

run;

View solution in original post

8 REPLIES 8
djrisks
Barite | Level 11

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.

adqs
Calcite | Level 5

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.

ChrisNZ
Tourmaline | Level 20

Why not just add a format statement?

proc sgrender data=testdata template=testapp;

  format y comma10.0;

run;

adqs
Calcite | Level 5

Thanks Chris,

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

ChrisNZ
Tourmaline | Level 20

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

adqs
Calcite | Level 5

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

ChrisNZ
Tourmaline | Level 20

There are still too many inconsistencies.    😞

djrisks
Barite | Level 11

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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