How can I get rid of the gap on the x-axis?

12 views (last 30 days)
Dear all,
I have the following code which results in the shown graph. However, I would like to make the graph prettier by avoiding the gap at the end of the x-axis as well as bigger spacing between the x-ticks and x-labels. Help is much appreciated :-)
app.UIAxesThUeberschuss.XLimMode = 'auto';
app.UIAxesThUeberschuss.YLimMode = 'auto';
app.UIAxesThUeberschuss.XTick = (0:hournum:projectlengthhour); % needed to show years instead of hours
app.UIAxesThUeberschuss.XTickLabel = (0:projectlength); % needed to show years instead of hours
  • hournum = 8760
  • projectlength = 30
  • projectlengthhour = 262800 (=hournum * projectlength)
  • is a 262800x1 vector
Maria Hart
Maria Hart on 2 Feb 2021
Nice, I tried
app.UIAxesPV_ungeordnet.XLim = [0 projectlengthhour];
and it worked. Thanks!

Sign in to comment.

Answers (1)

Constantino Carlos Reyes-Aldasoro
How about
axis tight
would that work?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by