help-octave
[Top][All Lists]
Advanced

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

Re: Problems with printed figures


From: Terry Duell
Subject: Re: Problems with printed figures
Date: Sat, 14 Dec 2013 09:00:21 +1100
User-agent: Opera Mail/12.16 (Linux)

Hello All
The confusion continues...

On Sat, 07 Dec 2013 16:28:18 +1100, Terry Duell <address@hidden> wrote:

OK, I think I have a solution... well it seems to work here.

Print the plot to ps, ie ' print("test_PSD.ps", "-dpsc2"); ' within Octave. Here I chose colour PostScript level 2. Convert the eps to svg using ' pstoedit -f plot-svg test_PSD.ps test_PSD.svg ' The conversion of many .ps files can be done via shell script in linux, making it quite painless. The resulting svg is as it should be. When the output is ps, the bounding box contains the plot correctly, i.e. BoundingBox: 0 0 612 792. Printing to eps gets it wrong with the plot displaced and cropped by the bounding setting.


In my delight at seeing x and y (horizontal and vertical) grids, and legend text all looking good in the resulting svg files, I completely overlooked the fact that only the major y (horizontal) grids were plotted. The x major and minor grids were plotted. I have since read and re-read the docs on what I can find on this and had no joy in being able to produce the y minor grid.
I suspect this is due to my ignorance, but maybe not.

Here is the plotting stuff from my script...
% plot psd
        [rawpower,rawfreq] = pwelch(acc,[],[],[],Fs);
        figure;
        loglog(rawfreq,rawpower,'b');
        legend("Predicted acceleration-PSD");
        grid("on");
        grid ("minor","on");
        axis("label","tic");
        legend("show")
        axis([0.1 400 0.0000000001 1])
        xlabel("hz")
        ylabel("g^2/hz")
        drawnow();
        print("PSD.svg","-dsvg");

I have experimented with bitmap output, ie jpg, with no joy.
Also tried axes commands i.e...

fig = gca();
set(fig,"xminorgrid","on");
set(fig,"yminorgrid","on");

and still no minor y grid.

I am running Octave 3.6.4 on fedora x86_64.

Does anyone else see this behaviour?
What is the trick to plotting the y minor grid ?

Cheers,
--
Regards,
Terry Duell


reply via email to

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