Data visualization with SAS programming

How to break histogram in Vbar graph SGplot

Reply
New Contributor
Posts: 4

How to break histogram in Vbar graph SGplot

hi All,

this is my first question to you and hope to be clear to help you in answer...

so .. my problem is to break the bigger histogram  to allow the other two (very little) to be shown better ...

i try to break it but unfortunately it remain the bigger!

in attachment you 'll find

1) data in input

2) graph before and after

 

i hope in your help to solve this topic

thank's in advance

Kregards

Pio

 

 

SAS Super FREQ
Posts: 1,265

Re: How to break histogram in Vbar graph SGplot

You can try breaking the y-axis.  Use the RANGES option in the y-axis statement to provide the range of data you want to keep.  If you are using SGPLOT procedure, then use something like:  

 

yaxis ranges=(0-250000 1000000-1400000);

 

It is easier to help if you provide your code with some sample data.

Esteemed Advisor
Posts: 5,408

Re: How to break histogram in Vbar graph SGplot

Try changing your y-axis to a logarithmic scale TYPE=log LOGBASE=10, and adding something like BASELINE=1000 to your VBAR statement.

PG
New Contributor
Posts: 4

Re: How to break histogram in Vbar graph SGplot

Hi PG,

what you suggest it's really whort for non stack graph as mine,because BASELINE is unsupported as VBAR statement in case of "STACK". Howevew i'll use it changing my graph.

 

Thank's a lot

Pio

Esteemed Advisor
Posts: 5,408

Re: How to break histogram in Vbar graph SGplot

A stacked VBAR with a Log scale might not be a good idea anyway. A broken axis doesn't look much better either. It is not clear what message you are trying to convey with your graph.

PG
Super User
Posts: 13,084

Re: How to break histogram in Vbar graph SGplot

Another option might be to use SGPANEL with your group variable a PanelBy variable and allow the rowaxis to vary between rows (values of group variable). Of course some care should be make so readers are aware that the different bits of the graph have different scales ...

Ask a Question
Discussion stats
  • 5 replies
  • 178 views
  • 2 likes
  • 4 in conversation