Desktop productivity for business analysts and programmers

gplot overlay scatter plot

Posts: 0

gplot overlay scatter plot

I have a chart I want to generate

the chart is basically a scatter plot with points connected with two sets of data.
the first is the measured data and the second is the estimates from a regression.

the independent axis is time

I can plot one set of points OK but when I try to plot the second set of points the interpolated straight line goes from following the values across time to zigzagging back and forth across the plot. I can't find any control in the eg interface to correct this problem. Do I have to do this in code?
Valued Guide
Posts: 2,111

Re: gplot overlay scatter plot

I think that you just need to sort the data by the values in the predicted line.

You may be able to do this as one of the Plot options of one of the regression tasks.
Posts: 0

Re: gplot overlay scatter plot

after going back and forth with SAS support I had to do it in code

the GUI wanted put in an sql sort even though I had the data sorted correctly the sql sort messed everything up. There seemed also to be no way around have the sort not included

I also had to code a macro variable to set the limits of the axis correctly. GPlot likes to scale each vertical axis independently. You can overcome this by putting an order= in an axis statement with the min max values but as I don't know ahead what the correct max value I had to code something like

max = rounde(max(avgvol,predicted_avgvol),100)+int(rounde(max(avgvol,predicted_avgvol),100))/5;

and then stick it into a macro variable then run my plot code through a macro to get the scales set correctly
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation