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;

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