Data visualization with SAS programming

Error in Xaxis of Gplot

Reply
Regular Contributor
Regular Contributor
Posts: 166

Error in Xaxis of Gplot

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.
SAS Employee
Posts: 967

Re: Error in Xaxis of Gplot

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!)
Regular Contributor
Regular Contributor
Posts: 166

Re: Error in Xaxis of Gplot

Allison,
Thanks for your reply,
But will it be possible to resolve the issue without having to feed in the order= for the Haxis?
SAS Employee
Posts: 967

Re: Error in Xaxis of Gplot

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);
Regular Contributor
Regular Contributor
Posts: 166

Re: Error in Xaxis of Gplot

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.
Ask a Question
Discussion stats
  • 4 replies
  • 161 views
  • 0 likes
  • 2 in conversation