Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem in exporting plotyy to a pdf file.
Replies: 4   Last Post: Sep 13, 2013 4:50 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 1,930
Registered: 12/6/04
Re: Problem in exporting plotyy to a pdf file.
Posted: Sep 10, 2013 7:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Nicki" wrote in message <l0mugr$g31$1@newscl01ah.mathworks.com>...
> Hi, I have this sample of my code to demonstrate my problem, it can be run as it is below:
>
> clc
> clear all
> close all
>
> Daynumber=randint(1,1,[1 10])
>
> Daymatrixyyname=genvarname(strcat('DybdeTempDag',num2str(Daynumber)))
>
> Daymatrix=[0.700856481481481,337,69,21.9000000000000,22.8000000000000,1;...
> 0.701550925925926,317,74,21.6000000000000,23.4000000000000,1 ...
> ;0.702245370370370,293,88,21.4000000000000,24.4000000000000,1; ...
> 0.702939814814815,317,88,21.1000000000000,23.5000000000000,1; ...
> 0.703634259259259,341,83,20.8000000000000,22.8000000000000,1;...
> 0.704328703703704,337,83,20.5000000000000,22.9000000000000,1;...
> 0.705023148148148,341,80,20.3000000000000,22.7000000000000,1;...
> 0.705717592592593,345,80,20.1000000000000,22.6000000000000,1;...
> 0.706412037037037,317,85,19.8000000000000,23.2000000000000,1;...
> 0.707106481481482,337,91,19.6000000000000,22.7000000000000,1;...
> 0.707800925925926,349,85,19.4000000000000,22.4000000000000,1;...
> 0.708495370370370,329,90,19.2000000000000,22.9000000000000,1;...
> 0.709189814814815,309,103,19,23.4000000000000,1;...
> 0.709884259259259,329,92,18.8000000000000,22.8000000000000,1]
>
> Dayplotyy=plotyy([1:length(Daymatrix(:,2))],Daymatrix(:,2)...
> ,[1:length(Daymatrix(:,2))],Daymatrix(:,4))
> hold on
> set(Dayplotyy(1),'YDir','reverse')
> xlabel('Måling#')
> axes(Dayplotyy(1)); ylabel('Dybde (m)')
> axes(Dayplotyy(2)); ylabel('Kernetemperatur (C)')
> ylim([15 30]);
> set(gca,'YTick',[15 18 21 24 27 30])
> title(Daymatrixyyname)
> saveas(Dayplotyy,Daymatrixyyname,'pdf')
>
>
>
> I get an error from the savefile function when ever I run this, but I cannot understand what I am doing wrong here, since this works just fine with an ordinary plot with just one y-axis. I suspect it has something to do with matlab referring to my plotyy with a matrix rather than a number? Anyhow, any help would be greatly appreciated.
>
> -Nicki Eriksen


What error message do you get?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.