BookmarkSubscribeRSS Feed
Bhupi
Fluorite | Level 6

Hi,

I want to produce superscript in the Y-axis label and in plot title. Can anyone please suggest the trick? The code before GPLOT is given below. Second issue I have with this code is that it is not generating different line styles but producing different colors. Third issue is that it is not increasing the thickness and smoothness of curves as per the code.

goptions reset=goptions nodisplay device=png300

         ftext='Times New Roman/bold' ftitle='Times New Roman/bold'

Symbol1 INTERPOL=LP5 w=2.5 Line=1;

Symbol2 INTERPOL=LP5 w=2.5 Line=2;

Symbol3 INTERPOL=LP5 w=2.5 Line=3;

Symbol4 INTERPOL=LP5 w=2.5 Line=35;

legend1 label=none  /*position=(left top inside) */;

axis1 order  = (30 to 110 by 10) offset = (2pct,2pct)

      value  = (angle=0 rotate=0)

      label  = (angle=0 'Days after planting')

      minor  = none

      origin = (15pct,20pct)

      length = 25pct; 

axis2 order  = (0 to 20 by 4) offset = (1,0)

      label  = (angle=90 'Total dry matter accumulation (Mg/ha)')

      minor  = none

      length = 60pct;

title1 move=(25pct,85pct) h=11pt "Nitrogen rate = 67 kg ha-1";

axis1  order = (30 to 110 by 10) offset = (2pct,2pct)

       label = (angle=0 'Days after planting')

       value  = (angle=0 rotate=0)

       minor = none

       origin = (40pct,20pct)

       length = 25pct;  

axis2  order  = (0 to 20 by 4) offset = (1,0)

       label  = none value=none

       minor  = none major=none

       length = 60pct;

title1 move=(50pct,85pct) h=11pt "Nitrogen rate = 134 kg ha-1";

Proc GPlot data= test;

   format estimate 8.0;

   where Nrate=134;

   Plot  estimate*sampling = cultivar/    haxis=axis1 vaxis=axis2 /*VMINOR=10*/

                             legend=legend1 GRID noframe name='Nrate2';

run; quit;

Thanks,

Bhupinder

3 REPLIES 3
ballardw
Super User

The last AXIS statement ecountered is used to build the axis, so the second AXIS2 with label=none is preventing your y axis. What part of the title do you want superscripted?

What part of the y axis label do you want superscripted?

Your symbol statements are going to use the default colors as in your current active style. If you want the same color specify in SYMBOL statemens c=black for instance (probably best), or a Goptions color list. Your symbol statements also all have the same width, 2.5, and interpolation options. LP5. So they will be the same width and the same smoothness.

Bhupi
Fluorite | Level 6

I want to keep superscript of (-1) in title1 move=(50pct,85pct) h=11pt "Nitrogen rate = 134 kg ha-1"; and in title1 move=(50pct,85pct) h=11pt "Nitrogen rate = 134 kg ha-1";

The full updated code runs as given below. I am able to change the color and line styles but I couldn't make look curves more smoother and thick. Changing W values didn't change the thickness.

goptions reset=goptions nodisplay device=png300

         ftext='Times New Roman/bold' ftitle='Times New Roman/bold'

            ;

Symbol1 INTERPOL=LP5 w=3.5 c=black L=1;

Symbol2 INTERPOL=LP5 w=3.5 c=black L=2;

Symbol3 INTERPOL=LP5 w=3.5 c=gray L=1;

Symbol4 INTERPOL=LP5 w=3.5 c=gray L=2;

legend1 label=none  position=(left top inside) across=1;

axis1 order  = (30 to 110 by 10) offset = (2pct,2pct)

      value  = (angle=0 rotate=0)

      label  = (angle=0 'Days after planting')

      minor  = none

      origin = (15pct,20pct)

      length = 25pct; 

axis2 order  = (0 to 20 by 4) offset = (1,0)

      label  = (angle=90 'Total dry matter accumulation (Mg/ha)')

      minor  = none

      length = 60pct;

title1 move=(25pct,85pct) h=11pt "Nitrogen rate = 67 kg ha-1";

Proc GPlot data= test;

   format estimate 8.0;

   where Nrate=67;

   Plot estimate*sampling = cultivar/    haxis=axis1 vaxis=axis2 /*VMINOR=10*/

                                        legend=legend1 GRID noframe name='Nrate1';

run; quit;

axis1  order = (30 to 110 by 10) offset = (2pct,2pct)

       label = (angle=0 'Days after planting')

       value  = (angle=0 rotate=0)

       minor = none

       origin = (40pct,20pct)

       length = 25pct;  

axis2  order  = (0 to 20 by 4) offset = (1,0)

       label  = none value=none

       minor  = none major=none

       length = 60pct;

title1 move=(50pct,85pct) h=11pt "Nitrogen rate = 134 kg ha-1";

Proc GPlot data= test;

   format estimate 8.0;

   where Nrate=134;

   Plot  estimate*sampling = cultivar/    haxis=axis1 vaxis=axis2 /*VMINOR=10*/

                              nolegend GRID noframe name='Nrate2';

run; quit;

axis1 order = (30 to 110 by 10) offset = (2pct,2pct)

      label = (angle=0 'Days after planting')

       value  = (angle=0 rotate=0)

      minor=none

      origin = (65pct,20pct)

      length = 25pct;  

     

axis2 order  = (0 to 20 by 4) offset = (1,0)

      label  = none value=none

      minor  = none major=none

      length = 60pct;

title1 move=(75pct,85pct) h=11pt "Nitrogen rate = 201 kg ha-1";

Proc GPlot data= test;

   format estimate 8.0;

   where Nrate=201;

   Plot  estimate*sampling = cultivar/haxis=axis1 vaxis=axis2  /*VMINOR=10*/

                                      nolegend GRID noframe name='Nrate3';

run; quit;

title1 "2010"; 

proc gslide name='gslide';

run;

quit;

goptions display gsfname=grafout xmax=9in ymax=5in;  

filename grafout 'C:\Users\bfarmaha\Desktop\TDM.jpeg'; 

title1 "2010";

proc greplay nofs tc=sashelp.templt template=whole;

   igout gseg;

   treplay 1:Nrate1 1:Nrate2 1:Nrate3 1:gslide;

run;

quit;

GraphGuy
Meteorite | Level 14

Are you 100% certain you're greplaying the latest graphs?

(You could try changing some of the title text, or color, etc just to make sure.)

As a temporary test, maybe try changing the line interpolation to something simple like 'i=join' and double or triple the width.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1142 views
  • 0 likes
  • 3 in conversation