[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #49243] printing causes error when figure axes
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #49243] printing causes error when figure axes has color "none" |
Date: |
Sat, 1 Oct 2016 21:27:42 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0 |
URL:
<http://savannah.gnu.org/bugs/?49243>
Summary: printing causes error when figure axes has color
"none"
Project: GNU Octave
Submitted by: sebald
Submitted on: Sat 01 Oct 2016 09:27:40 PM GMT
Category: Plotting
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
The following illustrates the problem:
octave:60> close all
octave:61> graphics_toolkit ('gnuplot')
octave:62> figure(1)
octave:63> plot([-10:10],[-10:10].^2,'o-')octave:64> set(gca, 'color',
'none')octave:65> print('-dpdflatexstandalone','-color','test')
ans = 1
hax = [](0x1)
ans = 0
error: 'n' undefined near line 412 column 15
error: called from
print at line 412 column 12
octave:65> graphics_toolkit ('fltk')
octave:66> figure(2)
octave:67> plot([-10:10],[-10:10].^2,'o-')
octave:68> set(gca, 'color', 'none')
octave:69> print('-dpdflatexstandalone','-color','test')
ans = 2
hax = [](0x1)
ans = 0
error: 'n' undefined near line 412 column 15
error: called from
print at line 412 column 12
octave:69> findall (2, "-depth", 1, "type", "axes", "-not", "tag",
"legend")ans = -80.669
octave:70> findall (2, "-depth", 1, "type", "axes", "-not", "tag", "legend",
"-not", "color", "none")
ans = [](0x1)
octave:71>
The code that is causing the error is this hunk from print.m:
if (do_hardcopy)
## Set background to white for all top-level axes objects
hax = findall (opts.figure, "-depth", 1, "type", "axes",
"-not", "tag", "legend",
"-not", "color", "none");
m = numel (props);
for n = 1:numel(hax)
props(m+n).h = hax(n);
props(m+n).name = "color";
props(m+n).value{1} = get(hax(n), "color");
set (hax(n), "color", "white");
endfor
nfig += n;
endif
As shown in line octave:70 above, the result of the find all is an empty set
because of the "-not","color","none" setting. We should consider if that
"color" "none" should in fact exclude printing, but also decide what to do
rather than let an error be thrown.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49243>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #49243] printing causes error when figure axes has color "none",
Dan Sebald <=