<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to customize the SGPLOT X and Y axis scales in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762028#M21869</link>
    <description>&lt;P&gt;When you want the graph like you want the graph, I often recommend using annotate ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's one way to get the values you want on the xaxis using annotate. I make the actual xaxis values 'white' (so they'll be invisible against the white background, but so they also 'reserve the space' for the labels I'm going to annotate). I've also modified your data section a bit to use a delimiter, so it will be easier for others to copy-n-paste and run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data ae0;
retain aestdateMin;
retain aeendateMax;
attrib aestdate informat=yymmdd10. format=date7.;
attrib aeendate informat=yymmdd10. format=date7.;
length aedecod $50;
format aestdateMin aeendateMax date7.;
drop aestdateMin aeendateMax;
input aeseq aedecod $ aesev $ aestdate aeendate;
aestdateMin=min(aestdate, aestdateMin);
aeendateMax=max(aeendate, aeendateMax);
call symputx('mindate', aestdateMin);
call symputx('maxdate', aeendateMax);
y=aeseq;
if aedecod=" " then y=-9;
infile datalines dlm=':';
datalines;
.: :MILD::2013-03-06:2013-03-06:Legend
.: :MODERATE::2013-03-06:2013-03-06:Legend
.: :SEVERE::2013-03-06:2013-03-06:Legend
1:DIZZINESS:MODERATE:2013-03-06:2013-03-07:
2:COUGH:MILD:2013-03-20:.:
3:APPLICATION SITE DERMATITIS:MILD:2013-03-26:2013-06-18:
4:DIZZINESS:MILD:2013-03-27:2013-03-27:
5:ELECTROCARDIOGRAM T WAVE INVERSION:MILD:2013-03-30:.:
6:DIZZINESS:MILD:2013-04-01:2013-04-11:
7:DIZZINESS:MILD:2013-04-01:2013-11-11:
8:APPLICATION SITE DERMATITIS:MODERATE:2013-03-26:2013-06-18:
9:HEADACHE:MILD:2013-05-17:2013-05-18:
10:APPLICATION SITE DERMATITIS:MODERATE:2013-03-26:2013-06-18:
11:PRURITUS:MODERATE:2013-05-27:2013-06-18:
;
run;&lt;BR /&gt;
data _null_;
set ae0;
minday=0;
maxday= &amp;amp;maxdate - &amp;amp;mindate;
minday10 = -20;
mindate10=&amp;amp;mindate - 20;
call symputx('minday', minday);
call symputx('maxday', maxday);
call symputx('minday10', minday10);
run;&lt;BR /&gt;
data ae2; set ae0;
aestdy= aestdate-&amp;amp;mindate+0;
aeendy= aeendate-&amp;amp;mindate+0;
stday=aestdy;
enday=aeendy;
if aestdy=. then do;
stday=&amp;amp;minday;
lcap='ARROW';
end;
if aeendy=. then do;
enday=&amp;amp;maxday;
hcap='ARROW';
end;
xs=0;
run;

data anno_x_values;
do x1=-20 to 100 by 10, 200, 300;
 output;
 end;
run;
data anno_x_values; set anno_x_values;
length label $300 x1space y1space anchor $50;
layer="front";
function="text"; textcolor="gray33"; textsize=8;
width=100; widthunit='percent';
x1space='datavalue';
y1space='wallpercent';
anchor='top';
y1=-1;
label=trim(left(x1));
run;

ods graphics / width=900px height=600px;
proc sgplot data=ae2 noautolegend nocycleattrs sganno=anno_x_values;
highlow y=aeseq low=stday high=enday / group=aesev lowlabel=aedecod type=bar
barwidth=0.8 lineattrs=(color=black) lowcap=lcap highcap=hcap name='sev';
scatter x=aestdate y=aeseq / markerattrs=(size=0);
refline 0 / axis=x lineattrs=(thickness=1 color=black);
yaxis display=(nolabel noticks novalues) type=discrete;
xaxis valueattrs=(color=white)
 label='Study Days' offsetmin=0.15 offsetmax=0.02
 values=(-20 to 300 by 10);
keylegend 'sev'/ title='Severity :';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot28.png" style="width: 900px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62652i0BE48A6D7B1017AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot28.png" alt="SGPlot28.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Aug 2021 12:00:06 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2021-08-17T12:00:06Z</dc:date>
    <item>
      <title>How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761689#M21854</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using below code I am getting the following output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="csa_1-1629049380589.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62608iE7D61DC2B0BEA5ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="csa_1-1629049380589.png" alt="csa_1-1629049380589.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;SAS Code:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;/*--Adverse Events timeline data--*/&lt;BR /&gt;data ae0;&lt;BR /&gt;retain aestdateMin;&lt;BR /&gt;retain aeendateMax;&lt;BR /&gt;attrib aestdate informat=yymmdd10. format=date7.;&lt;BR /&gt;attrib aeendate informat=yymmdd10. format=date7.;&lt;BR /&gt;format aestdateMin aeendateMax date7.;&lt;BR /&gt;drop aestdateMin aeendateMax;&lt;BR /&gt;input aeseq aedecod $ 5-39 aesev $ aestdate aeendate;&lt;/P&gt;&lt;P&gt;aestdateMin=min(aestdate, aestdateMin);&lt;BR /&gt;aeendateMax=max(aeendate, aeendateMax);&lt;BR /&gt;call symputx('mindate', aestdateMin);&lt;BR /&gt;call symputx('maxdate', aeendateMax);&lt;BR /&gt;y=aeseq;&lt;BR /&gt;if aedecod=" " then y=-9;&lt;/P&gt;&lt;P&gt;cards;&lt;BR /&gt;. MILD 2013-03-06 2013-03-06 Legend&lt;BR /&gt;. MODERATE 2013-03-06 2013-03-06 Legend&lt;BR /&gt;. SEVERE 2013-03-06 2013-03-06 Legend&lt;BR /&gt;1 DIZZINESS MODERATE 2013-03-06 2013-03-07&lt;BR /&gt;2 COUGH MILD 2013-03-20 .&lt;BR /&gt;3 APPLICATION SITE DERMATITIS MILD 2013-03-26 2013-06-18&lt;BR /&gt;4 DIZZINESS MILD 2013-03-27 2013-03-27&lt;BR /&gt;5 ELECTROCARDIOGRAM T WAVE INVERSION MILD 2013-03-30 .&lt;BR /&gt;6 DIZZINESS MILD 2013-04-01 2013-04-11&lt;BR /&gt;7 DIZZINESS MILD 2013-04-01 2013-11-11&lt;BR /&gt;8 APPLICATION SITE DERMATITIS MODERATE 2013-03-26 2013-06-18&lt;BR /&gt;9 HEADACHE MILD 2013-05-17 2013-05-18&lt;BR /&gt;10 APPLICATION SITE DERMATITIS MODERATE 2013-03-26 2013-06-18&lt;BR /&gt;11 PRURITUS MODERATE 2013-05-27 2013-06-18&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;/*proc print;run;*/&lt;/P&gt;&lt;P&gt;/*--Evaluate min and max day and dates--*/&lt;BR /&gt;data _null_;&lt;BR /&gt;set ae0;&lt;BR /&gt;minday=0;&lt;BR /&gt;maxday= &amp;amp;maxdate - &amp;amp;mindate;&lt;BR /&gt;minday10 = -20;&lt;BR /&gt;mindate10=&amp;amp;mindate - 20;&lt;BR /&gt;call symputx('minday', minday);&lt;BR /&gt;call symputx('maxday', maxday);&lt;BR /&gt;call symputx('minday10', minday10);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*--Compute start and end date and bar caps based on event start, end--*/&lt;BR /&gt;data ae2;&lt;BR /&gt;set ae0;&lt;/P&gt;&lt;P&gt;aestdy= aestdate-&amp;amp;mindate+0;&lt;BR /&gt;aeendy= aeendate-&amp;amp;mindate+0;&lt;BR /&gt;stday=aestdy;&lt;BR /&gt;enday=aeendy;&lt;/P&gt;&lt;P&gt;if aestdy=. then do;&lt;BR /&gt;stday=&amp;amp;minday;&lt;BR /&gt;lcap='ARROW';&lt;BR /&gt;end;&lt;BR /&gt;if aeendy=. then do;&lt;BR /&gt;enday=&amp;amp;maxday;&lt;BR /&gt;hcap='ARROW';&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;xs=0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*ods escapechar="^";*/&lt;/P&gt;&lt;P&gt;/*--Custom style for severity of events--*/&lt;BR /&gt;proc template;&lt;BR /&gt;define Style AETimelineV93;&lt;BR /&gt;parent = styles.htmlblue;&lt;BR /&gt;style GraphColors from graphcolors /&lt;BR /&gt;"gdata1" = cx5fcf5f&lt;BR /&gt;"gdata2" = cxdfcf3f&lt;BR /&gt;"gdata3" = cxbf3f3f;&lt;BR /&gt;style GraphFonts from GraphFonts /&lt;BR /&gt;'GraphDataFont' = ("&amp;lt;sans-serif&amp;gt;, &amp;lt;MTsans-serif&amp;gt;",5pt)&lt;BR /&gt;'GraphValueFont' = ("&amp;lt;sans-serif&amp;gt;, &amp;lt;MTsans-serif&amp;gt;",7pt)&lt;BR /&gt;'GraphTitleFont' = ("&amp;lt;sans-serif&amp;gt;, &amp;lt;MTsans-serif&amp;gt;",11pt);&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*--Draw the Graph--*/&lt;BR /&gt;ods html close;&lt;BR /&gt;ods graphics / reset width=5in height=3in imagename="Fig12_6_AETimeline_V93";&lt;BR /&gt;ods listing style=AETimelineV93 image_dpi=100;&lt;BR /&gt;title "Adverse Events for Patient Id = xx-xxx-xxxx";&lt;BR /&gt;proc sgplot data=ae2 noautolegend nocycleattrs;&lt;BR /&gt;/*--Draw the events--*/&lt;BR /&gt;highlow y=aeseq low=stday high=enday / group=aesev lowlabel=aedecod type=bar&lt;BR /&gt;barwidth=0.8 lineattrs=(color=black) lowcap=lcap highcap=hcap name='sev';&lt;/P&gt;&lt;P&gt;/*--Assign dummy plot to create independent X2 axis--*/&lt;BR /&gt;scatter x=aestdate y=aeseq / markerattrs=(size=0);&lt;/P&gt;&lt;P&gt;refline 0 / axis=x lineattrs=(thickness=1 color=black);&lt;/P&gt;&lt;P&gt;/*--Assign axis properties data extents and offsets--*/&lt;BR /&gt;yaxis display=(nolabel noticks novalues) type=discrete;&lt;BR /&gt;xaxis grid label='Study Days' offsetmin=0.02 offsetmax=0.02&lt;BR /&gt;values=(&amp;amp;minday10 to &amp;amp;maxday by 2);&lt;/P&gt;&lt;P&gt;/*--Draw the legend--*/&lt;BR /&gt;keylegend 'sev'/ title='Severity :';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query: In the x axis scale how can we utilize maximum scale between Day -20 to Day 100 by 10 and also display the values 200 and 300 in the scale? I have tried with LOGSTYLE and LOGBASE options None did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;csa&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 17:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761689#M21854</guid>
      <dc:creator>csa</dc:creator>
      <dc:date>2021-08-15T17:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761690#M21855</link>
      <description>&lt;P&gt;Use the VALUES= option of the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p07m2vpyq75fgan14m6g5pphnwlr.htm" target="_self"&gt;XAXIS&lt;/A&gt; and YAXIS statements in PROC SGPLOT.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 18:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761690#M21855</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-15T18:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761692#M21856</link>
      <description>&lt;P&gt;Thanks for the response. Values option already specified in the program&lt;/P&gt;&lt;P&gt;"xaxis grid label='Study Days' offsetmin=0.02 offsetmax=0.02&lt;BR /&gt;values=(&amp;amp;minday10 to &amp;amp;maxday by 2);"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I have tried with "xaxis grid label='Study Days' offsetmin=0.02 offsetmax=0.02&lt;BR /&gt;values=(-20 to 100 by 10, 200, 300);" It did not work. As in the below screenshot scale between 100-300 is equally distributed same as 0 to 100. I am trying reduce the scale between 100-300 and increase the scale between -20 to 100.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="csa_0-1629052042684.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62609iCA6A5E3E6C16CF83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="csa_0-1629052042684.png" alt="csa_0-1629052042684.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 18:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761692#M21856</guid>
      <dc:creator>csa</dc:creator>
      <dc:date>2021-08-15T18:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761693#M21857</link>
      <description>&lt;P&gt;How about trying the RANGES= option?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 18:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761693#M21857</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-15T18:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761694#M21858</link>
      <description>RANGES option has unnecessary extra line between values 100 - 200, also not displaying the tick values between -20 to 100 by 10.</description>
      <pubDate>Sun, 15 Aug 2021 19:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761694#M21858</guid>
      <dc:creator>csa</dc:creator>
      <dc:date>2021-08-15T19:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761697#M21859</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/310282"&gt;@csa&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use the log scale, then you cannot have 0 or negative numbers. You could add 1 to your AE start days and finish days. In many of my studies they also start from 1. And then you may be able to get the axis scale that you want. I also made the refline 1 instead of 0. Here is the example code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*--Draw the Graph--*/
ods html close;
ods graphics / reset width=5in height=3in imagename="Fig12_6_AETimeline_V93";
ods listing style=AETimelineV93 image_dpi=100;
title "Adverse Events for Patient Id = xx-xxx-xxxx";
proc sgplot data=ae2 noautolegend nocycleattrs;
/*--Draw the events--*/
highlow y=aeseq low=stday high=enday / group=aesev lowlabel=aedecod type=bar
barwidth=0.8 lineattrs=(color=black) lowcap=lcap highcap=hcap name='sev';

/*--Assign dummy plot to create independent X2 axis--*/
scatter x=aestdate y=aeseq / markerattrs=(size=0);

refline 1 / axis=x lineattrs=(thickness=1 color=black);

/*--Assign axis properties data extents and offsets--*/
yaxis display=(nolabel noticks novalues) type=discrete;
xaxis grid label='Study Days' type = log offsetmin=0.02 offsetmax=0.02 values=(1 10 20 30 40 50 60 70 80 90 100 200 300)
/*values=(&amp;amp;minday10 to &amp;amp;maxday by 2)*/;

/*--Draw the legend--*/
keylegend 'sev'/ title='Severity :';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bar chart range.png" style="width: 500px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62611i07D6A40992C57ED1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bar chart range.png" alt="Bar chart range.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 19:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761697#M21859</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-08-15T19:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761698#M21860</link>
      <description>You can use the RANGES and the VALUES option together, so that the values -20 to 100 are still shown.</description>
      <pubDate>Sun, 15 Aug 2021 19:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761698#M21860</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-08-15T19:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761802#M21862</link>
      <description>&lt;P&gt;You could use VALUESDISPLAY=() option to display 200 when it is 110, 300 when it is 120 .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;values=(0 to 120 by 10) valuesdisplay=('0' '10' '20' ............... '100'&amp;nbsp;&lt;STRONG&gt; '200'&amp;nbsp; '300'&lt;/STRONG&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 13:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/761802#M21862</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-08-16T13:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762028#M21869</link>
      <description>&lt;P&gt;When you want the graph like you want the graph, I often recommend using annotate ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's one way to get the values you want on the xaxis using annotate. I make the actual xaxis values 'white' (so they'll be invisible against the white background, but so they also 'reserve the space' for the labels I'm going to annotate). I've also modified your data section a bit to use a delimiter, so it will be easier for others to copy-n-paste and run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data ae0;
retain aestdateMin;
retain aeendateMax;
attrib aestdate informat=yymmdd10. format=date7.;
attrib aeendate informat=yymmdd10. format=date7.;
length aedecod $50;
format aestdateMin aeendateMax date7.;
drop aestdateMin aeendateMax;
input aeseq aedecod $ aesev $ aestdate aeendate;
aestdateMin=min(aestdate, aestdateMin);
aeendateMax=max(aeendate, aeendateMax);
call symputx('mindate', aestdateMin);
call symputx('maxdate', aeendateMax);
y=aeseq;
if aedecod=" " then y=-9;
infile datalines dlm=':';
datalines;
.: :MILD::2013-03-06:2013-03-06:Legend
.: :MODERATE::2013-03-06:2013-03-06:Legend
.: :SEVERE::2013-03-06:2013-03-06:Legend
1:DIZZINESS:MODERATE:2013-03-06:2013-03-07:
2:COUGH:MILD:2013-03-20:.:
3:APPLICATION SITE DERMATITIS:MILD:2013-03-26:2013-06-18:
4:DIZZINESS:MILD:2013-03-27:2013-03-27:
5:ELECTROCARDIOGRAM T WAVE INVERSION:MILD:2013-03-30:.:
6:DIZZINESS:MILD:2013-04-01:2013-04-11:
7:DIZZINESS:MILD:2013-04-01:2013-11-11:
8:APPLICATION SITE DERMATITIS:MODERATE:2013-03-26:2013-06-18:
9:HEADACHE:MILD:2013-05-17:2013-05-18:
10:APPLICATION SITE DERMATITIS:MODERATE:2013-03-26:2013-06-18:
11:PRURITUS:MODERATE:2013-05-27:2013-06-18:
;
run;&lt;BR /&gt;
data _null_;
set ae0;
minday=0;
maxday= &amp;amp;maxdate - &amp;amp;mindate;
minday10 = -20;
mindate10=&amp;amp;mindate - 20;
call symputx('minday', minday);
call symputx('maxday', maxday);
call symputx('minday10', minday10);
run;&lt;BR /&gt;
data ae2; set ae0;
aestdy= aestdate-&amp;amp;mindate+0;
aeendy= aeendate-&amp;amp;mindate+0;
stday=aestdy;
enday=aeendy;
if aestdy=. then do;
stday=&amp;amp;minday;
lcap='ARROW';
end;
if aeendy=. then do;
enday=&amp;amp;maxday;
hcap='ARROW';
end;
xs=0;
run;

data anno_x_values;
do x1=-20 to 100 by 10, 200, 300;
 output;
 end;
run;
data anno_x_values; set anno_x_values;
length label $300 x1space y1space anchor $50;
layer="front";
function="text"; textcolor="gray33"; textsize=8;
width=100; widthunit='percent';
x1space='datavalue';
y1space='wallpercent';
anchor='top';
y1=-1;
label=trim(left(x1));
run;

ods graphics / width=900px height=600px;
proc sgplot data=ae2 noautolegend nocycleattrs sganno=anno_x_values;
highlow y=aeseq low=stday high=enday / group=aesev lowlabel=aedecod type=bar
barwidth=0.8 lineattrs=(color=black) lowcap=lcap highcap=hcap name='sev';
scatter x=aestdate y=aeseq / markerattrs=(size=0);
refline 0 / axis=x lineattrs=(thickness=1 color=black);
yaxis display=(nolabel noticks novalues) type=discrete;
xaxis valueattrs=(color=white)
 label='Study Days' offsetmin=0.15 offsetmax=0.02
 values=(-20 to 300 by 10);
keylegend 'sev'/ title='Severity :';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot28.png" style="width: 900px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62652i0BE48A6D7B1017AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot28.png" alt="SGPlot28.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 12:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762028#M21869</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-08-17T12:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762230#M21875</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;X axis negative values have been converted to positive values. In graph negative values have been displayed using format.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 06:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762230#M21875</guid>
      <dc:creator>csa</dc:creator>
      <dc:date>2021-08-18T06:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762234#M21876</link>
      <description>You're welcome! That's a great solution! &lt;BR /&gt;&lt;BR /&gt;Also, if you are creating negative values just so that you can display the "DIZZINESS" AE text. You could also just increase the OFFSETMIN from 0.02 to 0.1, and that will display the complete AE name.</description>
      <pubDate>Wed, 18 Aug 2021 07:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762234#M21876</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-08-18T07:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize the SGPLOT X and Y axis scales</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762236#M21877</link>
      <description>&lt;P&gt;This is an example of how you can use the OFFSETMIN (and OFFSETMAX) option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example range2.png" style="width: 500px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62676i0077149150A1B68D/image-size/large?v=v2&amp;amp;px=999" role="button" title="example range2.png" alt="example range2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 07:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-customize-the-SGPLOT-X-and-Y-axis-scales/m-p/762236#M21877</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-08-18T07:33:08Z</dc:date>
    </item>
  </channel>
</rss>

