[Top][All Lists]

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

Re: Cant do simple XY plot

From: Nicholas Jankowski
Subject: Re: Cant do simple XY plot
Date: Mon, 9 Nov 2015 15:36:37 -0500

On Mon, Nov 9, 2015 at 3:22 PM, Dekome, Kent F. (JSC-ER611) <address@hidden> wrote:



From: address@hidden [mailto:address@hidden] On Behalf Of Nicholas Jankowski
Sent: Monday, November 09, 2015 1:33 PM
To: Help GNU Octave; Dekome, Kent F. (JSC-ER611)
Subject: Fwd: Cant do simple XY plot


----Original Message-----
From: address@hidden [mailto:address@hidden] On Behalf Of Nicholas Jankowski
Sent: Monday, November 09, 2015 12:40 PM
To: Dekome, Kent F. (JSC-ER611)
Cc: address@hidden
Subject: Re: Cant do simple XY plot


On Mon, Nov 9, 2015 at 12:11 PM, Dekome, Kent F. (JSC-ER611) <address@hidden> wrote:

> Installed the on Windows 7 to test its ability to handle

> Matlab mat files...

> Loaded my test file and all data vectors are showing up, yet when I

> try to do a simple XY plot the figure window remains blank…

> I can plot the X and Y vector independently, but nothing happens when I do:

> plot( HERA_TLM_T_EngineeringData_TIMETAG,

> HERA_TLM_T_EngineeringData_LastiLoadID)

> I also tried wrapping the last vector with “double” since it is loaded

> as “int16”…same result. Both these vectors are 102 x 1…

> plot( HERA_TLM_T_EngineeringData_TIMETAG,

> double(HERA_TLM_T_EngineeringData_LastiLoadID))

> Whats the probably obvious problem?


Can you share a sample of the data as it looks after loading into Octave?


---------- Forwarded message ----------
From: Dekome, Kent F. (JSC-ER611) <address@hidden>
Date: Mon, Nov 9, 2015 at 1:45 PM
Subject: RE: Cant do simple XY plot
To: Nicholas Jankowski <address@hidden>

Actually, here’s the plotting of the two vectors, I’m not sure why the first is displaying as it is, instead of  a ramp…its actually already been converted to “datenum” by the generating app…


Autoscale has no effect…



<snipped graphic showing time vector is array of 7.3628e5... numbers from datenum)







-Thanks for the detail Kent. Try to keep the mailing list in the conversation, and reply at the end to make it easier for others to follow the thread. Including your message and screenshots above.

Pretty sure your first graph is due to the timestamp magnitude. try generating an alternative x vector, one in seconds or a relative time.

>> newtimevector = HERA_TLM_T_EngineeringData_TIMETAG - now

The little script below shows the difference:


xvec = zeros(1,10000);

for idx1 = 1:10000

  xvec(idx1) = now;

  for idx2 = 1:100

    idx1+idx2; %(time delay loop)








At first I thought it might have to do with data numbersize limits (single precision vs double) but I think the plot routine is just trying to maintain an absolute scaling for both x and y axes including 0, which makes the time vector look like a flat line when plotted alone, and all the data crowds together at the right limit for x,y data:



plot(xvec, sin(xvec))




Do you have access to compare this to Matlab output for similar datasets?  It may be that Octave's current plotting routines need some tweaking.

Nick J.


Works in Matlab 2010b…

If I do :


>> A = HERA_TLM_T_EngineeringData_TIMETAG;

>> B = A - min(A);

>> plot( B, HERA_TLM_T_EngineeringData_LastiLoadID)


I get :

This appears correct…so how do I get that Matlab output using Octave?

Again, please Reply All so it keeps the Octave help-list in the loop. Especially for cases like now where I may need someone else to chime in with a suggestion.

It's not perfect, but I think manually changing the axes should do it.

For the script I used above, something like:

>> axis([min(xvec) max(xvec) min(sin(xvec)) max(sin(xvec))]);

will give axes that cover your min and max range, without including the zero.  Also, if you want code that works in both Matlab and Octave, I don't think that command will cause any problems.

Actually, I just found out by accident that hitting 'a' when the figure window is active auto-scaled the axes to min-max values for both x and y. So there's that.

Maybe someone else from the list can comment on whether the default axes spanning [0 max(vector)] is an intentional thing?

Nick J.

reply via email to

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