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

Hi all,

Will be very appreciate if someone help with deleteing background that takes half of screen, long story short - the code looks like:

Yura2301_0-1643280470925.png

And in the end the graph/tree drows as it shoulld but much below then title, I specially marked that area in green to make it visible:), so in the end graph looks like:

Yura2301_1-1643280613240.png

So shortly  - I would like that green area disappear at all so graph will move up and will be drawn right after the title, like it's in case of usual proc report or proc print.

 

Thanks in adwanced for any help! 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

These two options are in conflict, I think.

ods graphics / reset width=38.5cm height=50.8cm imagename="tst"
  attrpriority=none noborder;

And

proc sgplot data=Input noautolegend aspect=1;

aspect=1 indicates you want a square plot area, but your image canvas is 38.5x50.8cm. Remove the aspect option and the plot will fill the canvas better.

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

View solution in original post

4 REPLIES 4
ChrisHemedinger
Community Manager

It's easier to experiment with your use case if you post actual code instead of a screenshot. 

 

One thing to try: add the GTITLE option to your ODS output destination. This will make the title part of the graphical image instead of text outside of it. In SAS Enterprise Guide you can do this in code, assuming you're using HTML output:

/* EG v 8 using HTML5 */
ods html5(id=eghtml) gtitle;
/* or for EG 7 where HTML is used */
ods html(id=eghtml) gtitle;

 You can also set this preference in Tools->Options: Results. You can do the same for footnotes with GTFOOTNOTE.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Yura2301
Quartz | Level 8

Hi again Chris:)!

Thanks for your advices, tried everything - but ugly green background still on it place:)

 

The code(but please just change gpath option value ) :

 

proc sql;

create table WORK.Input

  (  

             LinkId num,

             NodeId num,

             Xn num,

             Yn num, 

             Xl num,

             Yl num,

             TxtLable char(100)

  );

 

  insert into Input values(1,1,1,9,1,9,'TST');

quit;

 

ods graphics / reset width=38.5cm height=50.8cm imagename="tst"

              attrpriority=none noborder;

                   ODS LISTING gpath='...path to output image';

          title 'Treee';

 

          proc sgplot data=Input noautolegend aspect=1;

            styleattrs backcolor=green;

            series  x=xl y=yl / group=LinkId attrid = yl lineattrs=(Pattern=solid ) arrowheadshape=barbed arrowheadpos=end;

            scatter x=xn y=yn / group=Yn

                                                                    markerattrs=(symbol=circlefilled size=1.5mm)

                                  filledoutlinedmarkers markerfillattrs=(color=black) markeroutlineattrs=(thickness=6)

                    dataskin=sheen datalabel=TxtLable datalabelpos=topright DATALABELATTRS=(Color=black Size=7);

            xaxis min=0 max=10 display=none;

            yaxis min=0 max=10 display=none;

          run;

          ods LISTING close;

 

Thanks one more time.

ChrisHemedinger
Community Manager

These two options are in conflict, I think.

ods graphics / reset width=38.5cm height=50.8cm imagename="tst"
  attrpriority=none noborder;

And

proc sgplot data=Input noautolegend aspect=1;

aspect=1 indicates you want a square plot area, but your image canvas is 38.5x50.8cm. Remove the aspect option and the plot will fill the canvas better.

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Yura2301
Quartz | Level 8

Hi again Chris,

The issue is fixed, perfect!:)

 

Many thanks!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 4 replies
  • 1475 views
  • 2 likes
  • 2 in conversation