Multiple Line Plots

Accepted Solution Solved
Reply
Contributor
Posts: 73
Accepted Solution

Multiple Line Plots

Hello SAS/Graph Community,

Considering this data structure:

  

HorizontalAxisVariableVerticalAxisVariable1VerticalAxisVariable2VerticalAxisVAriable3
Tens51020
TensA102040
TensB153080
TensC2040160

Will Multiple Line Plots By Group Column be useful to graph out this sort of dataset?

Or if there is some other better way to plot it, please share your thoughts.

Thanks,

Dhanashree Gadkari


Accepted Solutions
Solution
‎06-17-2013 08:20 AM
Super Contributor
Posts: 543

Re: Multiple Line Plots

Hi.

You could do this:

symbol i = join;

proc gplot data = in;

    plot (yaxis1 yaxis2 yaxis3)*  xaxis/overlay;

run;quit;

or this:

proc template;

define statgraph sgdesign;

begingraph / designwidth=1241 designheight=690;

   layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;

      layout overlay;

         barchart x=XAXIS y=YAXIS1 / name='bar' barwidth=0.2 discreteoffset=-0.29 groupdisplay=Cluster clusterwidth=1.0 fillattrs=(color=CXDEB68C );

         barchart x=XAXIS y=YAXIS2 / name='bar2' barwidth=0.16 discreteoffset=-0.1 groupdisplay=Cluster clusterwidth=1.0;

         barchart x=XAXIS y=YAXIS3 / name='bar3' datatransparency=0.4 barwidth=0.16 discreteoffset=0.08 groupdisplay=Cluster clusterwidth=1.0 fillattrs=(color=CXC6C3C6 );

      endlayout;

   endlayout;

endgraph;

end;

run;

proc sgrender data=WORK.IN template=sgdesign;

run;

Depends I guess on what are you trying to display, yes?

View solution in original post


All Replies
Solution
‎06-17-2013 08:20 AM
Super Contributor
Posts: 543

Re: Multiple Line Plots

Hi.

You could do this:

symbol i = join;

proc gplot data = in;

    plot (yaxis1 yaxis2 yaxis3)*  xaxis/overlay;

run;quit;

or this:

proc template;

define statgraph sgdesign;

begingraph / designwidth=1241 designheight=690;

   layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;

      layout overlay;

         barchart x=XAXIS y=YAXIS1 / name='bar' barwidth=0.2 discreteoffset=-0.29 groupdisplay=Cluster clusterwidth=1.0 fillattrs=(color=CXDEB68C );

         barchart x=XAXIS y=YAXIS2 / name='bar2' barwidth=0.16 discreteoffset=-0.1 groupdisplay=Cluster clusterwidth=1.0;

         barchart x=XAXIS y=YAXIS3 / name='bar3' datatransparency=0.4 barwidth=0.16 discreteoffset=0.08 groupdisplay=Cluster clusterwidth=1.0 fillattrs=(color=CXC6C3C6 );

      endlayout;

   endlayout;

endgraph;

end;

run;

proc sgrender data=WORK.IN template=sgdesign;

run;

Depends I guess on what are you trying to display, yes?

Contributor
Posts: 73

Re: Multiple Line Plots

That is it. You nailed it for me.

The transparency and groupdisplay options in barchart look very inviting worth switching my gears from line to bar chart. Once again thanks for your input.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 198 views
  • 1 like
  • 2 in conversation