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

Good day to all.

I'm newbie in SAS.
I need labeling each fourth dot like this: " was built in &year_of_release ".
&year - is a variable value that store in data set. My table has three values: year, year_of_release and freq.
Year (simple number like 2014) and freq3 (number like 0.00514554) are used in graph as X and Y.
Year_of_release (simple number like 2014) is used in graph as value for grouping.

There is my code (you can see that I tried to use a "pointlabel" option but it doesn't display an information that I need, it always show a "freq3" information for some reason):

                

%macro prognostic_graph;


goptions reset=all device=activex ypixels=600 xpixels=800;
  
;               
        
symbol1
  INTERPOL = join 
  VALUE = dot
  LINE = 1
  WIDTH = 1
  HEIGHT = 0.7
  POINTLABEL = ("#year_of_release");

;


Axis1

  STYLE = 0
  WIDTH = 0
  LABEL = (font="Arial/bold" a=90    Justify=center "Freq  ")  
  VALUE = (font="Arial" HEIGHT=9pt )    
  MINOR = none
  ORDER = (0 to 0.02 by 0.001)
  OFFSET = (0,0)

;   

Axis2 

                       
  ORDER = (2002 to 2018 by 1)
  STYLE = 0
  WIDTH = 0
  LABEL = (font="Arial/bold"    Justify=center "Years")  
  VALUE = (font="Arial" HEIGHT=9pt )
  COLOR = cx&gridColor
  MINOR = none                                    
  OFFSET = (0,0)
    ;
                               

                                                            
PROC GPLOT DATA=mergeDots;

  PLOT freq3 * year  = year_of_release  /
            VAXIS = AXIS1
            HAXIS = AXIS2
            NOFRAME                   
            GRID
            NOLEGEND
  ;
RUN;

        
%mend prognostic_graph;


Thank you for your attention.

1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

Try using device=png rather than device=activex.

The SAS/Graph device=activex implementation does not support all the customization features (such as pointlabel) fully.

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

TBH I would strongly suggest moving away from GPLOT to SGPLOT at minimum or preferably proc template/GTL.  You will have far more control over outputs.  Have a look at this blog which has hundreds of examples of graphs with most options you could ever need, with example code generally in sgplot and GTL.

http://blogs.sas.com/content/graphicallyspeaking/

reindeers
Fluorite | Level 6

Thank you for your recomendation! I will be work with SGPLOT next time.

GraphGuy
Meteorite | Level 14

Try using device=png rather than device=activex.

The SAS/Graph device=activex implementation does not support all the customization features (such as pointlabel) fully.

reindeers
Fluorite | Level 6

Thank you, your comment decided my problem!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1474 views
  • 3 likes
  • 3 in conversation