[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63820] ylim settings incorrect
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #63820] ylim settings incorrect |
Date: |
Thu, 23 Feb 2023 11:25:03 -0500 (EST) |
Follow-up Comment #7, bug #63820 (project octave):
I can reproduce this on the development branch. Octave shouldn't have this
issue, and it is very likely related to the single precision used in OpenGL.
For the time being, scaling your data and then changing the labels is the
best workaround. Here is an automated way to do that based on a callback
function which "listens" for changes on the "ytick" property of the axes.
clear all;
figure()
x = 1:10;
y = 1e-11:1e-11:1e-10;
ynew = 1e10 * y;
plot (x, ynew);
function cb_ytick (h, ~)
ytick = get (h, 'ytick');
ytick ./= 1e10;
ylabels = arrayfun (@(s) sprintf ("%.2g", s), ytick, 'uniformoutput',
false);
set (h, 'yticklabel', ylabels);
endfunction
addlistener (gca, 'ytick', @cb_ytick);
cb_ytick (gca); # Call once after initial plot to set limits
Once the plot is made and the listener is active you can execute normal
commands such as
# manually set Y limits
ylim ([0, 1.5])
# Have Octave choose Y limits
ylim auto
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63820>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect, anonymous, 2023/02/20
- Message not available
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect, anonymous, 2023/02/20
- Message not available
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect, Dmitri A. Sergatskov, 2023/02/20
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect, anonymous, 2023/02/20
- Message not available
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect, Pantxo Diribarne, 2023/02/20
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect, anonymous, 2023/02/21
- Message not available
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect, Pantxo Diribarne, 2023/02/22
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect,
Rik <=
- [Octave-bug-tracker] [bug #63820] ylim settings incorrect for small limits < 1e-7, Rik, 2023/02/23