BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
derekg
Obsidian | Level 7

I am trying to make a plot essentially showing means and confidence intervals for several different variables, and I want to have multiple dashed lines separating them at certain points. See screenshot below:

 

SGPlot35.png

 

The only thing I want to change is that I want "blank1" and "blank2" to actually show up as blank, i.e. no text/label in those spots. Currently I have my dataset set up so that there are two rows corresponding to the two blank spots, with missing means and bounds. The problem is that, if I try naming or formatting the variable name as " ", then they have the same name and so only one of the dashed lines shows up. Any suggestions as to how to accomplish what I'm aiming for?

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

With 9.40M3 (I did not check if this works with earlier releases) you can use a character format to do the same.  Keep the unique values in the category variable (like "a" and "b"), and then use a character format to format these to blank.  It is important to put the character format on the XAXIS  VALUESFORMAT option.  Putting the format on the data set variable will cause the formatted values of "a" and "b" to be merged as one category value.

View solution in original post

5 REPLIES 5
Reeza
Super User

Try setting one as a space and the second as a '09'x which is a tab?

Jay54
Meteorite | Level 14

Non breaking spaces 'A0'x (aka nbsp) can be used to create character strings that remain distinct and invisible. 

A string with one nbsp or more nbsps can be used.  Easy way to do this is to put a "." and a ".." in the column, then use translate() function to replace the "." with a 'A0'x.

 

https://blogs.sas.com/content/graphicallyspeaking/2012/09/03/doing-more-with-nbsp/

 

Jay54
Meteorite | Level 14

With 9.40M3 (I did not check if this works with earlier releases) you can use a character format to do the same.  Keep the unique values in the category variable (like "a" and "b"), and then use a character format to format these to blank.  It is important to put the character format on the XAXIS  VALUESFORMAT option.  Putting the format on the data set variable will cause the formatted values of "a" and "b" to be merged as one category value.

derekg
Obsidian | Level 7
This appears to have solved my problem! XAXIS VALUESFORMAT seems to be exactly what I needed, as it avoids the problem of the formatted values becoming merged together, which, as you mentioned, happens if you use a regular format statement. Thanks so much for your help!

hackathon24-white-horiz.png

Join the 2025 SAS Hackathon!

Calling all data scientists and open-source enthusiasts! Want to solve real problems that impact your company or the world? Register to hack by August 31st!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2058 views
  • 4 likes
  • 3 in conversation