BookmarkSubscribeRSS Feed
momin
Calcite | Level 5

proc gplot data=shareef.tra_pt_1m1;

plot mean_*day;

symbol value= star interpol=sm45;

run;

quit;

my x-axis values arein order in the columneg 3,7,15,30,90,180,360,720.

However in the plot i see it as

15,180,3,30,360,7,720

Thanks for help.

Regards

Mohammed Shareef

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Perhaps sort the input data, I know that sometimes the order is implied from the appearance in the data.  Alternatively, and my suggestion, move over to sgplot or GTL (these are the most up to date, and offer a great welth of customization), and explicitly specify all your axis.  You can find examples at: http://blogs.sas.com/content/graphicallyspeaking/

data_null__
Jade | Level 19

DAY must be character as this example demonstrates.

data mean;
   infile cards dsd;
  
input nday @@;
   day = put(nday,f8.-l);
   mean = ranuni(3);
   cards;
3,7,15,30,90,180,360,720
;;;;
   run;
proc gplot;
  
plot mean*day;
   plot mean*nday;
   run;
GraphGuy
Meteorite | Level 14

As data_null points out, your day values appear to be character, and the axis is therefore sorting alphabetically (rather than numerically). You could use 'proc contents' to verify that. You could add a numeric version of 'day' to your dataset (or add it in a temporary dataset), as follows...

data plot_data; set shareef.tra_pt_1m1;

day_numeric=.; day_numeric=day;

run;

proc gplot data=plot_data;

plot mean_*day_numeric;

symbol value= star interpol=sm45;

run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 3 replies
  • 1035 views
  • 0 likes
  • 4 in conversation