octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47974] Visual differences between gnuplot and


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #47974] Visual differences between gnuplot and OpenGL toolkits
Date: Fri, 3 Jun 2016 21:46:20 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

Follow-up Comment #55, bug #47974 (project octave):

ezsurf : #3 : position of titles is within the plot, rather than above it.

=====

Here's a patch to address the title placement in 3D plots (2D remains the
same).

I've concluded this is the same issue as some of the other sizing
peculiarities.  This originates from gnuplot and its new behavior with 5
series in which the sizing was changed slightly.  Roughly speaking, when "set
{}margin" is used, the size of the 3D plot is now about sqrt(3) larger than it
used to be:

https://sourceforge.net/p/gnuplot/bugs/1802/

I'm hoping this can be changed, but in lieu of that, it's also true that it is
difficult to adjust title placement because gnuplot only has relative adjust
for its title.  None of the Octave units:


>> set(ht, "units")
[ centimeters | {data} | inches | normalized | pixels | points ]


really lends itself to relative placement.  Nor, I should add, do these units
help in anyway for absolute placement (i.e., gnuplot's "screen" coordinate
system) in order to place a gnuplot label that is fixed rather than rotating
with the view (i.e., non roving).

So, the attached patch is the best I could do, and I actually think it isn't
too bad.  I've used a label for the title instead of "set title".  The
advantage is that absolute placement can be used, the existing text code can
be re-used, and as a consequence there might be some extra features like boxed
text that comes along with that.

The quirk is that I hijacked the role of the text object's "units". 
"normalized" now means screen position relative to plot 2D position.  Perhaps
I don't understand all the "centimeters", etc., but certainly "data" is a kind
of clumsy way of positioning a title.  That property has to be recomputed with
every mouse rotation in the Qt toolkit.  So, what I've done is better than
nothing, and it is actually pretty easy to use.

Try commands one at a time like:

sombrero
ht  = title("Sombrero")
[rotate view using mouse]
demo ezsurf
[enter a couple times to example #3]
set (get(gca, "title"), "position", [0.5, 0.95 0])
pos = get(gca, "position")
pos(4) = 0.75
set (gca, "position", pos)
set (get(gca, "title"), "position", [0.5, 1.04 0])

So, there is some control of things here so that the user can achieve an end
result--although the default settings may not be the best because of that
gnuplot 5.x behavior.  I think as we clear up the remaining few visual
differences, what remains will be size issue for which Ben can fine tune
things in that __actual_axis_position__() function.


(file #37383)
    _______________________________________________________

Additional Item Attachment:

File name: octave-gnuplot_title_placement-djs2016jun03.patch Size:7 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47974>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]