BookmarkSubscribeRSS Feed
NN
Quartz | Level 8 NN
Quartz | Level 8
Guys,
I tried using the following code to create a plot;

SYMBOL1 INTERPOL=spline HEIGHT=8pt VALUE=STAR CV=red LINE=1 WIDTH=1 ;
SYMBOL2 INTERPOL=spline HEIGHT=8pt VALUE=dot CV=green LINE=1 WIDTH=1 ;
Axis1 ORDER=(0 .1 .2 .3 .4 .5) MINOR=NONE WIDTH=2;
AXIS2 WIDTH = 2 ;

PROC GPLOT DATA = TEMP;
PLOT3D 'percent_column'n * MONTH ='group_column'n
/
GRID
VAXIS=AXIS1
HAXIS=AXIS2
NAME="PLOT"
noframe
;
RUN; QUIT;


The problem that i face is that in xaxis of the graph the Months keep on appearing twice. But the markers appear only once.
Please guide as to why is the month repeating in the graph.
4 REPLIES 4
GraphGuy
Meteorite | Level 14
Your xaxis (ie, haxis, which is axis2) is using automatic tickmarks.

Try specifying an order= in your axis2 statement, such that the tickmarks will be at the exact spots you want them!

Also, I believe plot3d is an "undocumented" feature(?) which only works in dev=acvivex (or java?) ... Perhaps try the same plot without the 3d, using dev=png, and see how it comes out. (3d is seldom a good choice, for plotting 2d data!)
NN
Quartz | Level 8 NN
Quartz | Level 8
Allison,
Thanks for your reply,
But will it be possible to resolve the issue without having to feed in the order= for the Haxis?
GraphGuy
Meteorite | Level 14
Can't really say, without seeing your data, and knowing what device= you're using (device=activex?), version of SAS, etc.

I assume your 'month' is actually a sas-date value, using the month. format?

It sounds like the activex gplot is picking tickmarks based on the numeric values of the dates, not really thinking in terms of what are good tickmarks for months. The tickmarks that are picked *might* be better with dev=png, depending on the data, etc (give it a try).

But to guarantee you get the axis exactly how you want it, I think you'll probably have to hard-code an order= on your axis statement, something like ...

axis1 order=('01jan2000'd to '01jul2000'd by month);
NN
Quartz | Level 8 NN
Quartz | Level 8
Robert,
you are right i am using the sas date value with month format. Now i understand why the tickmarks repeat.
I was creating a PDF file hece my Device was PDFC.
I have used the axis order= , it does give me the desired output.

Thanks a lot,

Still hope SAS comes up with some other way to tackle this

Rgds.

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!

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