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

Hi all,

I am a new SAS user and want to present the data in log scale for y (see data and code below).  But it does not work. Did I miss something? how to show minor tick marks?

Thanks

Muyi

data a;
input x y;
datalines;
0 31
2 69.4
4 78.3
6 82.4
8 51.1
10 34.1
;
run;

proc sgplot data=a;
xaxis label='x' values=(0 to 10 by 2) minor;
yaxis label='y' type=log logbase=10 ; 
series x=x y=y;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Documentation says, at least for my 9.2.3 install, that when the VALUES option is used then MINOR is ignored. You might try the MIN and MAX to control range of values displayed.

View solution in original post

6 REPLIES 6
Jay54
Meteorite | Level 14

Its working in my SAS 9.3 install.  Here is the graph.  Note the spacing of the values on the Y axis.  Default LOGSTYLE is LINEAR.  You can change that to LOGEXPAND or LOGEXPONENT.  Log will work as long as all the values are > 0.

SGPlot.png

Minor only works for LOGEXPAND and LOGEXPONENT, and you need more data range.  Here I scaled Y by 10:

SGPlot.png

muyi
Calcite | Level 5

thanks Sanjay!

I have a SAS 9.2, it works when including logstyle=logexpan, but how to show the y-axis scale range (e.g. from 0.1 to 100) and how to show the minor tick in the x-axis?

thanks

muyi

muyi
Calcite | Level 5

OK, it works now in my SAS 9.2 but the minor tick does not show in the x-axis, any suggestion?

data a;
input x y;
datalines;
0 31
20 694
40 783
60 824
80 511
100 341
;
run;

proc sgplot data=a;
xaxis label='x' values=(0 to 100 by 20) minor;
yaxis label='y' values=(1 to 1000) type=log logbase=10 logstyle=logexpand minor;
series x=x y=y;
run;

Jay54
Meteorite | Level 14

Minor only works with Log (LogExpand and LogExponent) and Time axis.  Minor is not supported for linear axis in 9.2 and 9.3.  It will be in 9.4.

ballardw
Super User

Documentation says, at least for my 9.2.3 install, that when the VALUES option is used then MINOR is ignored. You might try the MIN and MAX to control range of values displayed.

muyi
Calcite | Level 5

Thanks all for the hlep.  I love this community.  

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 7302 views
  • 1 like
  • 3 in conversation