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

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

[Octave-bug-tracker] [bug #35857] Octave crashes when plotting with unit


From: Rik
Subject: [Octave-bug-tracker] [bug #35857] Octave crashes when plotting with units = normalized
Date: Sat, 04 Apr 2015 17:54:26 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

Follow-up Comment #11, bug #35857 (project octave):

@jwe: The diff prevents the segfault, but the title and [xyz]labels all show
up at position (0,0,0).  The original code shows the problem.


set(0, "defaulttextunits", "normalized") ;
plot(0.05*[0 1])
title("T1") ;


The ordinary code, assuming no defaulttextunits, works correctly


plot(0.05*[0 1])
title("T1") ;
ht = get (gca, "title");
get (ht, "position")
ans =

   1.500000   0.051457   0.500000

set (ht, "units", "normalized");
get (ht, "position")
ans =

   0.50000   1.02914   0.00000



By setting some breakpoints I can see that the position field is updated in
normal 'data' mode. (It starts with
update_axes_layout->update_ticklength->update_xlabel_position->set_position). 
In fact, the first initialization() which is called through __go_axes__ works
fine.  It is the subsequent call to __go_axes_init__ which deletes the label
objects and then re-creates them that causes the problem.  The value in the
override of the position is definitely (0,0,0).

Backtrace is:


#0  text::properties::set_position (this=0x7fffd853c4f0, val=...) at
corefcn/graphics.h:7761
#1  0x00007ffff6fe52a8 in text::properties::update_units
(this=0x7fffd853c4f0)
    at corefcn/graphics.cc:8180
#2  0x00007ffff701719a in text::properties::set_units (this=0x7fffd853c4f0,
val=...)
    at corefcn/graphics.h:8217
#3  0x00007ffff6f5a28e in text::properties::set (this=0x7fffd853c4f0,
pname_arg=..., val=...)
    at corefcn/graphics-props.cc:3315
#4  0x00007ffff7004221 in base_graphics_object::set (this=0x7fffd853c4e0,
pname=..., pval=...)
    at corefcn/graphics.h:2993
#5  0x00007ffff6ef8a66 in base_properties::set_from_list (this=0x7fffd853c4f0,
obj=..., 
    defaults=...) at corefcn/graphics.cc:2882
#6  0x00007ffff70041a7 in base_graphics_object::set_from_list
(this=0x7fffd853c4e0, plist=...)
    at corefcn/graphics.h:2985
#7  0x00007ffff700661d in root_figure::override_defaults (this=0x655760,
obj=...)
    at corefcn/graphics.h:3794
#8  0x00007ffff70050c8 in graphics_object::override_defaults
(this=0x7fffdc9141b0, obj=...)
    at corefcn/graphics.h:3264
#9  0x00007ffff6ef9762 in base_properties::override_defaults
(this=0x7fffd84acc50, obj=...)
    at corefcn/graphics.cc:3066
#10 0x00007ffff7009ea1 in figure::override_defaults (this=0x7fffd84acc40,
obj=...)
    at corefcn/graphics.h:4918
#11 0x00007ffff70050c8 in graphics_object::override_defaults
(this=0x7fffdc914240, obj=...)
    at corefcn/graphics.h:3264
#12 0x00007ffff6ef9762 in base_properties::override_defaults
(this=0x7fffd84dbdb0, obj=...)
    at corefcn/graphics.cc:3066
#13 0x00007ffff70138c5 in axes::override_defaults (this=0x7fffd84dbda0,
obj=...)
    at corefcn/graphics.h:7188
#14 0x00007ffff70050c8 in graphics_object::override_defaults
(this=0x7fffdc9142d0, obj=...)
    at corefcn/graphics.h:3264
#15 0x00007ffff6ef9762 in base_properties::override_defaults
(this=0x7fffd853c4f0, obj=...)
    at corefcn/graphics.cc:3066
#16 0x00007ffff7004139 in base_graphics_object::override_defaults
(this=0x7fffd853c4e0, obj=...)
    at corefcn/graphics.h:2974
#17 0x00007ffff6fed071 in gh_manager::do_make_graphics_handle (this=0x654d10,
go_name=..., p=..., 
    integer_figure_handle=false, do_createfcn=false, do_notify_toolkit=true)
    at corefcn/graphics.cc:9131
#18 0x00007ffff7028e26 in gh_manager::make_graphics_handle (go_name=...,
parent=..., 
    integer_figure_handle=false, do_createfcn=false, do_notify_toolkit=true)
    at corefcn/graphics.h:13239
#19 0x00007ffff6fc9b36 in axes::properties::set_defaults (this=0x7fffd84dbdb0,
obj=..., mode=...)
    at corefcn/graphics.cc:5077
#20 0x00007ffff7013a67 in axes::set_defaults (this=0x7fffd84dbda0, mode=...)
    at corefcn/graphics.h:7211
#21 0x00007ffff700516e in graphics_object::set_defaults (this=0x7fffdc9156c0,
mode=...)
    at corefcn/graphics.h:3290
#22 0x00007ffff6ff4730 in F__go_axes_init__ (args=...) at
corefcn/graphics.cc:10736


More to the point,


get (0, 'defaulttextposition')
ans =

   0   0   0



If I change 'defaultextposition' to something reasonable for normalized units
([0.5, 0.5, 0]) then the label shows up correctly (middle of screen).

I tried


hx = get (gca, 'xlabel');
set (hx, 'positionmode', 'auto');


but this may be meant for something else because it set the position value in
"data" units completely ignoring the "normalized" value on xlabel.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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