BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tebunah
Calcite | Level 5

stepplot.jpg

Dear Community, sample_plot_expected.jpg

 

While trying to compute some step chart, I came across to the code listed below found in the SAS help documentation.

title "Stock Trend for IBM";
proc sgplot data=sashelp.stocks
  (where=(date >= "01jan2004"d and stock = "IBM"));
  step x=date y=close;
run;

The hand's drawing is the plot I would like to compute: the challenge appears to the visual aspect as the attribute on the y-axis will be ranked by order/ severity ascendant.

 

Please advise.

Thanks  in advance.

S

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

It may be time to clarify the question. Do you have a dataset you want to plot? If so, what does the data look like. You can follow instructions from this link: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to make datastep code that can be pasted here for the variables of interest.

 

Or are you trying to get values from an existing graph?

View solution in original post

5 REPLIES 5
ballardw
Super User

You may be looking for the annotate feature to draw lines at points decided by values in the data. BUT you will have to provide the code on how to select a point and then draw the horizontal and vertical unless you want the lines at each corner.

If you only want your values of interest then you would suppress the default axis statements and supply your values which might be easiest with the annotate.

Tebunah
Calcite | Level 5
Thanks ballardw, actually the lines are not required @ each corner. the dashes were to reference them from the other axis. However I wou
Tebunah
Calcite | Level 5
Sorry 😞 I would be interested in the annotation.
Did you mean renaming them ?
Thanks
ballardw
Super User

It may be time to clarify the question. Do you have a dataset you want to plot? If so, what does the data look like. You can follow instructions from this link: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to make datastep code that can be pasted here for the variables of interest.

 

Or are you trying to get values from an existing graph?

Tebunah
Calcite | Level 5
Thanks ballardw, actually was trying to convert the numerical values from y-axis to categorical for visualization purpose. I used the 'proc format' to solve it. Many Thaanks

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 989 views
  • 0 likes
  • 2 in conversation