- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am making a HIGHLOW plot
data w; input x y _ $; datalines; -2.460 17 A -0.977 12 A 0.014 18 A 0.984 18 A 2.429 6 A -0.33 -1 B -0.97 -1 B 0.61 -1 B 0.69 -1 B ; run; data w; set w; if _ = 'A' then do; high = y; low = 0; end; if _ = 'B' then do; high = 0; low = y; end; proc sgplot data = w; highlow x = x low = low high = high / type = bar group = _ barwidth = 0.95; run;
I must be doing something wrong since all values of barwidth gives me the same plot. Any suggestions about what I am doing wrong ?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @karlbang,
If you don't want to change the axis type: For your linear X axis the INTERVALBARWIDTH= option is applicable. Try values like 0.07in, 1.5mm, 4px, 6, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
From the HIGHLOW statement option BARWIDTH documentation:
Requirement This option is applicable only when the X or Y axis is discrete.
So you need to add an XAXIS statement setting TYPE=DISCRETE.
@karlbang wrote:
I am making a HIGHLOW plot
data w; input x y _ $; datalines; -2.460 17 A -0.977 12 A 0.014 18 A 0.984 18 A 2.429 6 A -0.33 -1 B -0.97 -1 B 0.61 -1 B 0.69 -1 B ; run; data w; set w; if _ = 'A' then do; high = y; low = 0; end; if _ = 'B' then do; high = 0; low = y; end; proc sgplot data = w; highlow x = x low = low high = high / type = bar group = _ barwidth = 0.95; run;I must be doing something wrong since all values of barwidth gives me the same plot. Any suggestions about what I am doing wrong ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @karlbang,
If you don't want to change the axis type: For your linear X axis the INTERVALBARWIDTH= option is applicable. Try values like 0.07in, 1.5mm, 4px, 6, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content