help-octave
[Top][All Lists]
Advanced

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

Re: Print Problem: Figure Background won't get printed


From: PhilipNienhuis
Subject: Re: Print Problem: Figure Background won't get printed
Date: Sun, 21 Feb 2016 10:46:36 -0800 (PST)

aikon96 wrote
> Hey there,
> 
> I'm just trying to get a plotted Octave figure to file.
> So I plotted everything -> OK, set the background of the figure to black
> and wanted to print it to file.
> My Octave plot looks like this:
<http://octave.1599824.n4.nabble.com/file/n4674940/pic.png> 
> So by using the print command, I always get a white background of the
> figure:
<http://octave.1599824.n4.nabble.com/file/n4674940/test.jpg> 
> 
> 
> Can someone help me to get the black background at saved file?
> Using ubuntu 15.10, Octave v.4.0.0
> 
> My code:
> 
> 
> 
> 
> 
> clear all
> close all
> clc
> 
> graphics_toolkit ('qt')
> 
> x = linspace(0,2*pi,100);
> 
> 
> figure(1)
> set(gcf,'Color',[0,0,0]) 
> plot(sin(x))
> hold on
> rectangle('Position',[0 -1 100 2],'FaceColor','Black')
> grid on
> set(gca, 'YColor', [1 1 1])
> set(gca, 'XColor', [1 1 1])
> hold off
> 
> print('test.png')
> 
> 
> 
> 
> 
> 
> So by using this print command I get transparent background, but how to
> get a black background?
> print(gcf, '-dpngalpha',test.png);

On my system (Windows 7 with Seamonkey browser, using nabble [1]) the second
plot in your mail shows up with a nice black background, but w/o axes, axes
ticks and axes labels.

Just try yourself:
http://octave.1599824.n4.nabble.com/template/NamlServlet.jtp?macro=reply&node=4674940

It looks like there is something else going on.

Philip



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Print-Problem-Figure-Background-won-t-get-printed-tp4674940p4674942.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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