help-octave
[Top][All Lists]
Advanced

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

Re: "printing" graphics files through aquaterm on an Apple


From: Ben Abbott
Subject: Re: "printing" graphics files through aquaterm on an Apple
Date: Sun, 03 Jul 2011 11:52:42 -0400

On Jul 2, 2011, at 11:50 PM, Obed Sands wrote:

> On Fri, Jul 1, 2011 at 8:55 PM, Ben Abbott <address@hidden> wrote:
> 
>> On Jul 1, 2011, at 5:17 PM, Obed Sands wrote:
>> 
>> > I use Octave for a lot of data analysis, statistical analysis of data etc. 
>> > I frequently make graphics files using Octave. Lots of them. Bar charts, 
>> > line graphs, pseudo color (viz specgram) etc. Octave's graphics come out 
>> > on the Apple looking great through auquaterm.
>> >
>> > However, I've been frustrated for some time now with the creation of 
>> > graphics files as provided by ghostscript using the "print" command in 
>> > Octave.  If I use a format such as pdf or svg the files can be enormous, 
>> > if I use jpg then the characters are tiny and I can't rescale them--or if 
>> > I manage to rescale them then the characters end up running into the 
>> > graphics or the axis label. Inserting them in documents is always a 
>> > challenge. The graphics usually come out jaggy or washed out. I've tried 
>> > all different combinations of -dpdf, -djpg, -deps -FTimes-Roman, etc. I 
>> > usually get a message that indicates that they font I'm trying to use is 
>> > no good.
>> >
>> > But if I simply use the "save as" feature of aquaterm then all is well. 
>> > The graphics file that aquaterm makes look as great coming out of the 
>> > files they're stored in as as they do when first rendered on the screen. 
>> > pdfs, jpegs, whatever, they all seem to do well. I can insert them in 
>> > files, print them out, rotate and, generally, abuse them and they always 
>> > do fine. The problem is that I make so many graphics that I'm wearing out 
>> > mice (and my patience) generating the graphics files one at a time with 
>> > aquaterm. The clik-o-rama that I have to do is error prone and 
>> > frutstrating.
>> >
>> > So here's my question(s):
>> >
>> > 1) Is there some way, in octave to "print" so that aquaterm renders the 
>> > graphics files (instead of GS)?
>> > 2) If no, then is there any plan to 'fix' the rendering of graphics by GS 
>> > or to get it so that it works and plays better with the Apple? The version 
>> > of GS that I've got is 9.02 (dated 2011-03-30) and so I don't think that 
>> > my problem is that I've got an outdated GS.
>> > 3) Is there any other hope for me? While I would, personally, prefer it, 
>> > going to linux is just not an option for me.
>> >
>> > Regards,
>> >
>> > oss
>> 
>> The output using print has under gone many recent changes. Please tell us 
>> which version of Octave you are using. It would also be helpful is you can 
>> provide a simple script which demonstrates your problem.
>> 
>> Ben
> 
> Hello Ben,
> 
> I'm using Octave 3.2.4:
> 
> Octave:1> ver
> ----------------------------------------------------------------------
> GNU Octave Version 3.2.4
> GNU Octave License: GNU General Public License
> Operating System: Darwin 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 
> 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
> ----------------------------------------------------------------------
> Package Name   | Version | Installation directory
> ---------------+---------+-----------------------
>            io *|   1.0.9 | /opt/local/share/octave/packages/io-1.0.9
> miscellaneous *|   1.0.9 | /Users/osands/octave/miscellaneous-1.0.9
>           nan  |   1.0.9 | /Users/osands/octave/nan-1.0.9
>         optim *|   1.0.6 | /Users/osands/octave/optim-1.0.6
>          plot *|   1.0.7 | /opt/local/share/octave/packages/plot-1.0.7
>        signal *|  1.0.11 | /Users/osands/octave/signal-1.0.11
>       specfun *|   1.0.9 | /Users/osands/octave/specfun-1.0.9
>           tsa *|   4.0.1 | /Users/osands/octave/tsa-4.0.1
> 
> Here's an example script and the response to the print command that I get 
> concerning fonts:
> 
> octave:2> imagesc(rand(400)); colormap(hot)
> octave:3> xlabel('Horizontal (mm)')
> octave:4> ylabel('Vertical (mm)')
> octave:5> title('Example image')
> octave:6> print('-djpg', 'example.jpg')
> Could not find/open font when opening font "arial", using internal 
> non-scalable font
> 
> I've attached two jpgs, the one called 'example.jpg' is the result of the 
> print command. The other named 'example from aquaterm.jpg' is the result of 
> saving the file to a pdf and then getting preview to render it as a jpg. The 
> one made with the print command has very small characters. If I manage to get 
> them larger then they tend to run into the graphic. However, while the 
> characters are a little jaggy in the aquaterm generated graphic, you can read 
> them just fine.
> 
> If this helps then I can provide other examples.
> 
> Scott Sands

I see you're missing the Arial font. On my Mac I avoid the error regarding 
"Arial" but using Helvetica instead.

        set (0, "defaultaxesfontname", "Helvetica")
        set (0, "defaulttextfontname", "Helvetica")

The font problems you're having originate with gnuplot, and should not be 
resolved with the more recent release of 3.4.2 (not 3.2.4)

It looks to me as if you are using MacPorts to install Octave. Correct? 

If so, you it is possible for you to upgrade to 3.4.2. I'm not a MacPorts user, 
but it looks to me like a port file is available for local installation at the 
link below.

        https://trac.macports.org/ticket/29919

Some instructions for installing local port files are below.

        http://guide.macports.org/#development.local-repositories

If you're hesitant to setup a local port file, you can experiment with changing 
the font sizes of the text objects in combination with changing the output 
resolution.

To change the fontsizes of all objects in the current figure to 14pts ...

        set (findall (gcf, "-property", "fontsize"), "fontsize", 14)

To change the output resoluiton use the print option "-SXSIZE,YSIZE". For 
example for a 640 by 480 output ....

        print fig.jpg -S640,480

Ben




reply via email to

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