help-octave
[Top][All Lists]
Advanced

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

Re: Problems with printed figures


From: Juan Pablo Carbajal
Subject: Re: Problems with printed figures
Date: Sat, 14 Dec 2013 11:34:58 +0100

On Fri, Dec 13, 2013 at 11:00 PM, Terry Duell <address@hidden> wrote:
> 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
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave

I can't reproduce (Debian 7 Jessie, GNU Octave 3.7.7+)
x = logspace(0,2,100);
y = 0.1*x.^3;
loglog(x,y)
grid on
set(gca,"xminorgrid","on")
print -dsvg "test.svg"

Saves an SVG with all grids on it. I daresay that you problem is due
to the library used to generate SVG, in case fltk it seems to be
gpl2ps and I do not know what gnuplot is using (my case).


reply via email to

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