BookmarkSubscribeRSS Feed
Pyrite | Level 9

I used sgplot to plot a series gaph but I want to adjust the x and y axis scale a bit. the scale of the yaxis begins a little bit higher as 0 while the x axis begins exactl y at 0. I want both to start from 0 . Is there any way to do that?

Diamond | Level 26 RW9
Diamond | Level 26

Yes, you would use an xaxis or yaxis with the specific options:

Probably min/max or values in your case.  AS I have no example I can't be specific, but something like

xaxis values=(0 1 2 3 4);

Will put ticks at 0 1 2 3 4

Meteorite | Level 14

Some plot statements request an axes ranges of only the data range of the variables, such as Scatter or Series.  So, if the y-axis variable data is from 100-200, the y-axis range will show around 100-200.  You can change that by setting options on the axis.  Other plot statements always include zero in the response axis range, such as the bar chart.  If there a mixture of plot types, the union of the data requested by the plots is used.


If you do not need to control each tick value, you can just set the MIN or MAX values:


yaxis min=0;

Pyrite | Level 9

Thanks to you all. I tried using min=0 but it didn't work. I wanted the scale this way:


 this is what I wantthis is what I want


presently the scale looks like this: which I don't likepresently the scale looks like this: which I don't like


From the graph snippet you posted, it appears that you have a line going below 0, which would account for the 0 tick location. Can you confirm this?

Meteorite | Level 14

Ahh - I think you're wanting to get rid of the 'offset' (the space along the axis before zero).


xaxis offsetmin=0;

yaxis offsetmin=0;


Pyrite | Level 9

Yes DanH_sas, this is true but I don't want it this way how can I correct that so that I get something like in graph one?


I still have another question concerning the line  and grid thickness. It seems the graph (which is the second pic) is very thin.

Is there any way to make these thicker, so that it looks like the first graph.


Also is there any way to compress the height of the graph to look like the first graph?


Can one add special fonts which are not available in sas graph to graph options if this is installed on my pc?


I will be grateful for any help



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 5 in conversation