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

Hello,

 

I am trying to skip certain dates on the x-axis, see code below.

proc sgplot data=finaldata;
vbar date;
xaxis label='Event date' values=('10Dec2018'd to '01Jun2019'd by week);
yaxis label='Number of events' values=(0 to 6 by 2) offsetmin=0;
run;

 

Date has values: 

 

10Dec2018

02Feb2019

05Feb2019

09Feb2019

22Feb2019

01Mar2019

11Mar2019

22May2019

25May2019

 

I want to skip the months with no values but still space it out by specified ticks

 

thanks in advance

HabAM
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Not really understand what you need.

Try range= option.

 

xaxis label='Event date'  range=('10Dec2018'd - '01Jan2019'd ,  '01May2019'd- '01Jun2019'd);

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

So you want one tick per date in the data, evenly spaced?

HabAM
Quartz | Level 8

I didn't know I could specify multiple ranges values as above. Thanks

HabAM
Ksharp
Super User

Not really understand what you need.

Try range= option.

 

xaxis label='Event date'  range=('10Dec2018'd - '01Jan2019'd ,  '01May2019'd- '01Jun2019'd);

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 3 replies
  • 1540 views
  • 0 likes
  • 3 in conversation