BookmarkSubscribeRSS Feed
Sarah16
Calcite | Level 5

Hi all,

 

I am getting 1 st diagram as my output but I needed output same as like the 2nd diagram.

 

I have used the following code.

 

proc sgplot data=graph;

highlow y=term low=stdy high=endy / type=line group=ser
lineattrs=(pattern=solid) barwidth=0.8 highcap=FILLEDARROW ;
scatter y=term x=adurn / x2axis markerattrs=(size=0);
xaxis grid display=(nolabel) offsetmax=0.02 values=(0 to 60 by 2);
yaxis grid display=(noticks nolabel);
run;

 

1. the Plot term should present inside the graph. (I have specified with arrow)

 

2. I have to specify condition at the end plot. (please refer to the second diagram)

 

Thanks in advance.MH_GRAPH_MINE.PNGMH_GRAPH_ORIGINAL.PNG

 

3 REPLIES 3
ballardw
Super User

Data.

 

Hard to plot something we don't have.

 

How do we know what is supposed to be plotted with the dashed line?

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Ksharp
Super User
data have;
 set sashelp.class;
 min=11;max=16;
 run;


proc sgplot data=have;
scatter x=max y=name/markerchar=sex;
scatter x=min y=name / markerchar=name;
yaxis display=none grid ;
run;
DanH_sas
SAS Super FREQ

You can use AXISTABLEs to get what you want:

 

data class;
set sashelp.class;
cap="Arrow";
run;

proc sgplot data=class;
yaxis display=(noticks novalues) grid;
highlow y=name high=weight low=height / hgihcap=cap;
yaxistable name / location=inside position=left;
yaxistable weight / location=inside position=right;
run;

Hope this helps!

Dan

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!

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.

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