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

Hi,   

 

I created this plot using sgplot-highlow with type=BAR. I want to remove the space between each bars so that i don't see the individual bars .  

 

Capture.PNG

 

Regards

San  

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

RTF uses vector graphics converted into EMF+.  So, the mapping may not be perfect since you have black background (seeping through the gaps).  You may be better off using a BAND with TYPE=Step.  This will give you a continuous plot without gaps.

View solution in original post

14 REPLIES 14
ballardw
Super User

@hello28 wrote:

Hi,   

 

I created this plot using sgplot-highlow with type=BAR. I want to remove the space between each bars so that i don't see the individual bars .  

 

Capture.PNG

 

Regards

San  


It helps to show the code you used so we don't suggest something that conflicts with the options you have already used.

If the xaxis is descrete perhaps you want the option BARWITH=1 on the HIGHLOW statement.

hello28
Calcite | Level 5

proc sgplot data=plotx ;
highlow x=xbar low=ybar_low high=ybar_high /type=bar barwidth=1 dataskin= NONE fillattrs=(transparency=0.5) ;
xaxis values=(0 to 26 by 2) label='Label of X';
yaxis values=(0 to 26 by 2) label='Label of y' ;

styleattrs wallcolor=black;
run;

 

 

 

i need the high and low of each points connected (without showing each individual bars).

i do get this in proc gplot with plot and plot2 for high and low. however i need the wall color in black which i dont know how to get while i use gplot. 

Ksharp
Super User

Did you try 

highlow................/ noborder

hello28
Calcite | Level 5

noborder is throwing a syntax error in 9.4

Jay54
Meteorite | Level 14

Use NOOUTLINE.

 

data foo;
do i=0 to 10;
low=i+10;
high=low+5;
output;
end;
run;

 

proc sgplot data=foo;
highlow x=i low=low high=high / type=bar barwidth=1 nooutline;
run;

 

hello28
Calcite | Level 5

Hi Sanjay, 

 

It Works fine in SAS Output . However when i output the image in RTF , there are some random lines. 

 

Do you know why these are coming up?

 

Capture2.PNG

Jay54
Meteorite | Level 14

RTF uses vector graphics converted into EMF+.  So, the mapping may not be perfect since you have black background (seeping through the gaps).  You may be better off using a BAND with TYPE=Step.  This will give you a continuous plot without gaps.

hello28
Calcite | Level 5

Thanks Sanjay, it worked. 🙂 

Jay54
Meteorite | Level 14

Thanks to KSharp for follow-up post.

Ksharp
Super User

Here is Sanjay suggested.

 


data foo;
do i=0 to 10;
low=i+10;
high=low+5;
output;
end;
run;

 

proc sgplot data=foo;
styleattrs wallcolor=black;
band x=i lower=low upper=high / type=step   ;
run;
hello28
Calcite | Level 5

Hi, 

 

I have a situation now. 

 

Is it possible to plot two ranges or bands for same point on the 'x' axis. ?

 

From above Example: i=2; low = 12; high=14;

                                    i=2; low = 16; high=17; 

 

Ksharp
Super User

Make two variables and two BAND statements.

 

i=2; low = 12; high=14;

 _i=2; _low = 16; _high=17; 

 

 

band x=i lower=low upper=high / type=step   ;
band x=_i lower=_low upper=_high / type=step   ;

 

hello28
Calcite | Level 5

band.png

 

 

My data is like,

 

x=0, y=0;

x=0, y=1;

x=0, y=2;

x=1, y=0;

x=1, y=1;

x=1, y=2;

x=2, y=0;

x=2, y=1;

x=2, y=2;

x=2, y=3;

When i use Band plot , it plots the coordinates on Xaxis and connects the next coordinates 

 

I want to fill the grids where these points meets on x and y. For x=0 and y=0,1,2, i want to fill the three grids shown in the picture

Jay54
Meteorite | Level 14

Not clear to me.  But if you want to fill the grids, you could use a HeatMap or HeatMapParm and indicate the grids that are filled and empty.  X & Y bins can be interval or discrete.  Bins can be marked at center or on edges.

See:  https://blogs.sas.com/content/graphicallyspeaking/2016/05/20/ctspedia-graphs-heatmap-of-benefit-and-...

You can also use HEATMAP in SGPLOT.

 

Also, it is preferable to start a new thread for a new issue.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 14 replies
  • 4398 views
  • 0 likes
  • 4 in conversation