Cannot produce fig file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot produce fig file

kpchiao
This post was updated on .
Hi,

I recently upgrade ubuntu from 16.04 to 18.04. Ths octave is also upgraded to 4.2.2.

I found that the plot cannot be print to fig (for opening in xfig) using the following command.

For example,

plot(sin([0:0.1:pi]))

print ('sin.fig', '-dfig')

The contents in sin.fig are simply the header lines without any xfig object related commands as  in the following:

#FIG 3.2
Portrait
Flush left
Inches
Letter
100.00
Single
0
1200 2

Is there anyone can help me out this?

BTW, I also recompile octave 4.4.0, and it is still the same.
Best regards,
kpchiao
Reply | Threaded
Open this post in threaded view
|

Re: Cannot produce fig file

Pantxo
kpchiao wrote

> Hi,
>
> I recently upgrade ubuntu from 16.04 to 18.04. Ths octave is also upgraded
> to 4.2.2.
>
> I found that the plot cannot be print to fig (for opening in xfig) using
> the following command.
>
> For example,
>
> plot(sin([0:0.1:pi]))
>
> print ('sin.fig', '-dfig')
>
> The contents in sin.fig are simply the header lines without any xfig
> object related commands as  in the following:
>
> #FIG 3.2
> Portrait
> Flush left
> Inches
> Letter
> 100.00
> Single
> 0
> 1200 2
>
> Is there anyone can help me out this?
>
> BTW, I also recompile octave 4.4.0, and it is still the same.

Hi,

This works for me both with Octave 4.2.x and 4.4.

In opengl based toolkits (the  default "qt" toolkit and "fltk"), Octave
first creates an EPS file, using gl2ps, which is further converted into FIG
format  by pstoedit. Are you able to print successfully to EPS ?

plot (1:10);
print foo.eps

If the above works, then there maybe something wrong with pstoedit. The
following is approximately how Octave calls pstoedit for final conversion

/usr/bin/pstoedit -f fig foo.eps > foo.fig


Pantxo






--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Cannot produce fig file

kpchiao
Thanks the response from Pantxo.
The reason why fig cannot be created is due to the bug in ghostscript 9.22.  
I found a solution (temporarily) in ubuntu 18.04. The steps are:
1. Download the ghostscript 9.23  here
<https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs923/ghostscript-9.23-linux-x86_64.tgz>
.
2. Untar it at, say, /foo/.
3. sudo mv /usr/bin/gs /usr/bin/gs_orig_922
4. sudo ln -s /foo/ghostscript-9.23-linux-x86_64/gs-923-linux-x86_64
/usr/bin/gs
5. Done!

That works, and the fig file will be created correctly inside octave GUI.
But this is not a proper way to cope with such bug. I hope ubuntu guys will
fix this is bug in the next version (say, 18.04.1).

BTW, how do I announce such bug to the ubuntu developers?



-----
Best regards,
kpchiao
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Best regards,
kpchiao