BookmarkSubscribeRSS Feed
FelixSta20
Obsidian | Level 7

gbarlin4.png

This is how  ready graph is looking out while using procedure 

call Series(xx, yy)
grid={XX YY}

within IML procedure. 

So far I could not found the way to control  tickmark label for horizontal axe.

Unlike SAS graph procedures providing full control for such an attributes.

Is there any ways to provide such a control?

 

12 REPLIES 12
PeterClemmensen
Tourmaline | Level 20

You can control the xaxis tick marks using the xvalues option on the Call Series Statement:

 

proc iml;
   x = do(-5, 5, 0.25);
   y = x/5 + sin(x);
   call Series(x, y) xvalues = {-4 0 4};
quit;

If you do not want any ticks at all, you can simply specify a value outside of X's range.

FelixSta20
Obsidian | Level 7

The idea is to put labels for the first and  last values on date axe and for the beginning of each month. While using SAS graph procedures, I was doing this by generating sas format for these values, and after that applying this format in graph procedure. 

It seems, call Series doesn't  work with formatted values

 

PeterClemmensen
Tourmaline | Level 20

Can you post a sample of your data? Makes it easier to give you a usable code answer.

PeterClemmensen
Tourmaline | Level 20

I think this is what you want. Remember that Call Series calls Proc SGPLOT behind the scenes. So basically, you can do the same things

 

proc iml;
x = '01jan2020'd : '19Nov2020'd;
y = 1 : ncol(x);
call Series(x, y) other="format x date9.";
quit;

Result:

 

SGPlot23.png

 

FelixSta20
Obsidian | Level 7

yes, this seems to be become a solution. I will check if sas-generated formats by proc format will be accepted by procedure.

 

PeterClemmensen
Tourmaline | Level 20

Also, you can use the Other Option in the Call Series Statement to send an entire statement to the SGPLOT Procedure being called behind the scenes like this

 

Btw, I just took the example from the documentation

 

proc iml;
   x = do(-5, 5, 0.25);
   y = x/5 + sin(x);
   call Series(x, y) other = "xaxis display=(noticks novalues)";
quit;

Result:

 

SGPlot9.png

 

PeterClemmensen
Tourmaline | Level 20

I moved this thread to the IML Forum.

FelixSta20
Obsidian | Level 7

Sorry, correction: this graph  have been produced by 

proc gbarline data=dsin;
format date1;

symbol1 c=red value=dot;
axis1 label=("New Cases");
axis2 label=("Total Count");
axis3 value=(a=-45);
bar date1 / discrete sumvar=newca raxis=axis1 maxis=axis3 levels=all;
plot / sumvar=totca axis=axis2;
run;

So, the challenge is how to use formatted value for date1 variable in this procedure

When I use  

format date1 date_fmt.;

 with generated format date_fmt , the output looks like 

 

 

gbarlin8.png

 

 

 

 

PeterClemmensen
Tourmaline | Level 20

@FelixSta20 This seems to be a new request and not IML related. Therefore, please close this thread and start a new one with your new question 🙂

FelixSta20
Obsidian | Level 7
It is IML. Since procedure gbarline is running within IML procedure

Rick_SAS
SAS Super FREQ

If you are trying to create graphs from within IML, please read the section "How the Graphs Are Created" in the IML documentation. It explains the basic principle, which is that you can write data from IML to a SAS data set and use the SUBMIT/ENDSUBMIT blocks to call ANY SAS procedure (including SAS/GRAPH procedures). The built-in graphics are thin-wrappers around calls to PROC SGPLOT and support many common options. 

 

By using the same technique, you can create your own custom graphs without leaving IML. Of course, if you are done with your IML computation, you can also write the data, QUIT out of IML, and then use your favorite procedure directly.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 12 replies
  • 1379 views
  • 6 likes
  • 3 in conversation