BookmarkSubscribeRSS Feed
cb100
Calcite | Level 5

Does anyone know how to plot left and right axes with different scales using SGpanel?

I saw an example with SGplot, but I need sgpanel to create 4 plots in a row.

Ideally I would have:

Plot 1 (left) with left y-axis say in %, Plot 2 (mid left) with no y-axis, Plot 3 (mid right) with no y-axis, and Plot 4 (right) with right axis in say meters.

Thanks much!

1 REPLY 1
Jay54
Meteorite | Level 14

SG Procedures are meant to support the common 80-20 use cases.  Your requirement for a panel graph with separate Y and Y2 axis goes beyond its scope.

GTL does support such graphs and here is an example using data modified from sashelp.class with a % format for the right axis.  Code is attached.  I have also customized the axes to allow grid lines and color coding.  BarChart in Layout Prototype will support summarization of data by category.  For other plot types, you can use proc means to compute the summarized data.

DualAxisPanel_GTL.png

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
  • 1 reply
  • 952 views
  • 0 likes
  • 2 in conversation