Labels and grid lost during drawing

It looks that my case at least the ‘labels’ & ‘grid’ were ‘lost’ during the drawing of the triangles:

when using below code:
rot1.m (2.3 KB)
and improved code:
rot2.m (1.8 KB)

Your octave is old. It works in 6.3.0

Was a version and operating system reported? At least for Octave 6.3.0 and OpenSUSE 15.3 no lost labels & grids either.

jari@ENVY-17:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description: Linux Mint 20.2
Release: 20.2
Codename: uma

jari@ENVY-17:~$ octave -version
GNU Octave, version 5.2.0

This might be octave version vs. OS version issue then…
The octave was packages that I got by the ‘sudo apt install octave’ (included in the distribution), but still maybe not fully functional.

Version 5.2.0 is very old and no longer supported. You should try and upgrade to the latest stable version. There are several possibilities. You could use a containerized version of Octave such as one provided by Snap or Flatpak. Or you could download the source and build from scratch. It isn’t that hard on a Linux system like Mint.

To give a link to @rik 's suggestion: Octave for GNU/Linux - Octave (“2. Distribution independent” section), I would recommend Snap or Flatpak for your case too.

Improving the code & ‘accurate presentation’ added:
rot2.m (6.8 KB)

I haven’t yet checked running your script.
But it looks like you are calling subplot for the same “grid” position repeatedly. The re-use or replace detection sometimes goes wrong (e.g. if the axes position changed slightly when decorations were added).
Consider storing the axes handle returned by subplot and using that handle instead of calling subplot for the same “grid” position again. That is also mentioned in the documentation of subplot: Multiple Plots on One Page (GNU Octave (version 6.3.0)).

Tks. I try check, but also some problems with ZorinOS16+octave6.2.0:
jari@ENVY-17:~$ octave
Qt: Session management error: Could not open network socket
QApplication: invalid style override passed, ignoring it.
Fontconfig warning: “/etc/fonts/fonts.conf”, line 5: unknown element “its:rules”
Fontconfig warning: “/etc/fonts/fonts.conf”, line 6: unknown element “its:translateRule”
Fontconfig error: “/etc/fonts/fonts.conf”, line 6: invalid attribute ‘translate’
Fontconfig error: “/etc/fonts/fonts.conf”, line 6: invalid attribute ‘selector’

A post was split to a new topic: How to treat infinite integrals in Octave

OK. TKS. I already though it could be too much under this topic.

1 Like