[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52184] 'position' axes property value is inco
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit |
Date: |
Sat, 7 Oct 2017 14:56:23 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #5, bug #52184 (project octave):
I'm surprised there is no 'units' specification that allows what you are
attempting. E.g.,:
WITH FLTK TOOLKIT
octave:21> graphics_toolkit fltk
octave:22> figure
octave:23> plot (-2:2,-2:2)
octave:24> h = annotation("line", [0,1], [0,1])
h = -231.34
octave:25> set(h,'units')
[ centimeters | characters | inches | {normalized} | pixels | points ]
octave:26> set(h,'units','points')
octave:27> set(h,'units')
[ centimeters | characters | inches | {normalized} | pixels | points ]
That last 'points' doesn't seem to do anything. Perhaps that doesn't make
sense for a line specification. Nonetheless, there is no type of
'data'-relative specification. Why? I don't know. It seems that would be
useful thing to have.
But I will point out that 'data' isn't probably the best nomenclature for that
because there can be multiple axes on a plot, so the question is what "data"
are we referring to if the axes are totally different scale and range? So,
rather than "data", maybe a type 'axes' makes more sense with some reference
to the axes object.
WITH GNUPLOT TOOLKIT
octave:29> graphics_toolkit gnuplot
octave:30> figure
octave:31> plot (-2:2,-2:2)
octave:32> h = annotation("line", [0,1], [0,1])
h = -274.29
octave:33> set(h,'units')
[ centimeters | {data} | inches | normalized | pixels | points ]
It's already set for 'data', but as I see it, it's acting like "normalized" in
the plot. So, gnuplot toolkit has a 'data' units option, but it doesn't seem
to be working right now.
What's funny is that your fail-example can be made to work in gnuplot toolkit
with the following:
graphics_toolkit('gnuplot');
figure
fplot(@(x) sin(x), [0 2*pi]);
position = get(gca(), 'position')
h = annotation('arrow', [position(1) position(1) + position(3)], [position(2)
position(2) + position(4)]);
set(gca,'Position',position+[1 0 0 0])
set(gca,'Position',position)
It's as if the Position property doesn't affect anything until it is changed
from the default. That could be fixed probably. gnuplot makes better use of
the full window though.
Anyway, let me know your thoughts on the annotation specification relative to
an "axes". Such an internal code addition seems the easiest route to me,
i.e., all toolkits have the property.
It seems the bug here is simply that you want the gnuplot plot box position to
look similar to the smaller width/height of the FLTK and Qt plots. Correct?
There's no way to modify gnuplot manually within the plot and feed back
coordinates to the toolkit.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52184>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Etienne Dechamps, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Mike Miller, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Etienne Dechamps, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Michael Godfrey, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Etienne Dechamps, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit,
Dan Sebald <=
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Etienne Dechamps, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Dan Sebald, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Etienne Dechamps, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Dmitri A. Sergatskov, 2017/10/07
- [Octave-bug-tracker] [bug #52184] 'position' axes property value is incorrect when using gnuplot toolkit, Michael Godfrey, 2017/10/07