4

I have build some algorithm and now I should make things pretty enough for presentation. Only problem what I have is a "strange" legend behaviour in octave. I dont know if the problem is because I am using "subplot" function, but I have tried several ideas what was possible to find on google, but none of that really works.

At the uploaded picture we can see that diagram lines names are moved all the way to the left (nothing wrong with that), however there is too much space on the right side of the line names. The legend box is simply too big for the context inside. I have tried already with reducing the size of the font, but is not the best solution.

enter image description here

Can somebody please provide some solution for my problem. My current code status is:

hleg1 = legend({"sample1", "sample2", "sample3"});
set(hleg1, "FontSize", 8);

I currently using Octave version 5.1.0 on windows 10 x64.

Pukaai
  • 367
  • 1
  • 4
  • 14
  • Which backend are you using? Did you try a different backend? In any case, don't forget to also include your version of Octave and what OS you are running it on. – Cris Luengo Jul 08 '19 at 14:46
  • I have edit my post, so that I have add version of Octave and OS informations. I dont know what you mean with backend? Sorry, but I am beginner in Octave. Can you please explain me more (link or similar)? Thanks! – Pukaai Jul 09 '19 at 06:05
  • 1
    They're called [toolkits](https://octave.org/doc/v4.0.1/Graphics-Toolkits.html) in Octave documentation, my bad. These are the software components that produce the actual graphics on the screen. There's different options, and they each have a unique set of bugs... :p – Cris Luengo Jul 09 '19 at 07:39
  • Aaaa ... toolkits ... no I didn't try it :) Thanks for the attached link, I will try also this set of unique bugs :P – Pukaai Jul 10 '19 at 08:26

1 Answers1

0

The fix for me was te execute the plotting script twice. The first time you resize the window in full screen mode. Then you execute the script again (without closing the figure window) Now legends should not take half the space of your plot ;)

Dakom
  • 11
  • 5