BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
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.
deleted_user
Not applicable
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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