# How to scale x-axis in MatLab?

1.028 views (last 30 days)
Robert Flores on 18 Apr 2018
Commented: Robert Flores on 18 Apr 2018
Hello, this may be a very simple question, but how would one scale the x-axis in MatLab? I want to have the x-axis start at -190 and end at 200, with increments of 10. I have my input data plotted, i'll attach a figure. If you can help, great!
-Robert
Robert Flores on 18 Apr 2018
Below is a copy of my script:
Temp = [100,75,50,25,0,-25,-50,-65,-75,-85,-100,-125,-150,-175];
Impact_Energy = [89.3,88.6,87.6,85.4,82.9,78.9,73.1,66,59.3,47.9,34.3,29.3,27.1,25];
plot(Temp,Impact_Energy,'r*')
title('Impact Energy V. Temperature')
xlabel('Temperature, measured in C')
ylabel('Impact Energy, measured in J')
xlim([-180 110])
ylim([20 90])
-Robert

Von Duesenberg on 18 Apr 2018
```Temp = [100,75,50,25,0,-25,-50,-65,-75,-85,-100,-125,-150,-175];
```
```Impact_Energy = [89.3,88.6,87.6,85.4,82.9,78.9,73.1,66,59.3,47.9,34.3,29.3,27.1,25];
```
```plot(Temp,Impact_Energy,'r*')
title('Impact Energy V. Temperature')
xlabel('Temperature, measured in C')
ylabel('Impact Energy, measured in J')
set(gca, 'XLim', [-190, 200], 'XTick', -190:10:200,...
'XTickLabel', -190:10:200);
```
##### 2 CommentsShowHide 1 older comment
Robert Flores on 18 Apr 2018
Nevermind, I just needed to stretch the image, thanks.
-Robert