help-octave
[Top][All Lists]
Advanced

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

Re: Scatter Plotting


From: Stephen H. Dawson
Subject: Re: Scatter Plotting
Date: Fri, 10 Jun 2016 19:49:12 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

GNU Octave is great!

Attached are my working m file and the ODS I am using for my data
source. Everything works as expected.

GOALS:
-Add labels to each object. I have this listed in the ODS on the Data
worksheet, column 2. Can I feed this information into GNU Octave? If
not, how does one add a label to each object?

-I will print this on a monochrome laser printer, so object colors may
not matter. Anyway, how does one change the object colors when using the
scatter3 function?

-Perhaps a legend. I understand the legend function does not work with
the scatter3 function.

-I export to JPG and PDF but only see grid lines on 1 axis. Is there a
trick to getting the grid lines to print on all axes?


Thank you for your assistance.

Thank You,
Stephen H. Dawson
(865) 804-3454
http://www.linkedin.com/in/shdcs


On 06/10/2016 12:39 PM, Stephen H. Dawson wrote:
> OK, I apologize to all for my:
> -incorrectly calling a variable by the variable name and;
> -referencing column numbers by defined range instead of worksheet column
> number.
>
> (/sigh)
>
>
> This syntax works nicely returning the expected results:
>
> clf;
> dataSet = odsread ('./CubeGraphing.ods', 'Data', 'C2:E5');
> x = dataSet(:,1)
> y = dataSet(:,2)
> z = dataSet(:,3)
> scatter3(x, y, z, 20,"r","filled");
>
>
>
>
> A few housekeeping questions, please:
>
> -How does one run the odsread function from the command line to read the
> data array?
>
> -How can I add labels to these axes?
>
> -How can I add labels to these values? I have the labels in the
> worksheet now, in column B, if that is an option.
>
> -How can I set the axis scale from -10 to +10?>
>
> -Where are the instructions for color options? I read somewhere one can
> feed red/blue/green colors?
>
>
> Great day, first graph. HOORAY!!!
>
>
>
> Thank You,
> Stephen H. Dawson
> (865) 804-3454
> http://www.linkedin.com/in/shdcs
>
>
> On 06/10/2016 12:06 PM, Stephen H. Dawson wrote:
>> Hi,
>>
>>
>> Working on this effort to use worksheet data to feed into a
>> three-dimensional cube graph.
>>
>> I have an ODS worksheet with data formatted as numeric in three columns
>> with an x, y, and z header. I have read through the odsread function.
>>
>> http://wiki.octave.org/IO_package#ODS_support
>>
>> I understand I am loading the data into a memory variable called A.
>>
>> I have looked at working examples of  three-dimensional cube graph.
>>
>> I am unclear how to feed memory variable A to the syntax.
>>
>>
>> WORKING DIRECTORY:
>>>> ls -la *.ods
>> -rw-r--r-- 1 stephen stephen 10612 Jun 10 11:54 CubeGraphing.ods
>> -rw-r--r-- 1 stephen stephen 27218 Feb 18 11:30 Quadrant Graphing.ods
>>
>> FUNCTIONAL SYNTAX:
>> clf;
>> x = rand (20,1);  y = rand (20,1);  z = rand (20,1);
>> scatter3 (x(:), y(:), z(:), 20*z(:), z(:), 's');
>> title ({'scatter3() plot', ...
>>          'marker is square, size and color determined by Z'});
>>
>>
>>
>> DEVELOPMENTAL SYNTAX:
>> clf;
>> A = odsread ('./CubeGraphing.ods', 'Data', 'C2:E5');
>> [x, y, z] = peaks (20);
>> scatter3 (x(:), y(:), z(:), [], z(:));
>>
>>
>> How do I call memory variable A into the data array and list?
>>
>> Am I correct I list with the scatter3 function?
>>
>> Thank You,
>> Stephen H. Dawson
>> (865) 804-3454
>> http://www.linkedin.com/in/shdcs
>>
>>
>> On 06/06/2016 04:10 PM, Stephen H. Dawson wrote:
>>>>> pkg list
>>> Package Name  | Version | Installation directory
>>> --------------+---------+-----------------------
>>>           io *|   2.0.2 | /usr/share/octave/packages/io-2.0.2
>>> Fantastic. Thanks, all.
>>>
>>> Thank You,
>>> Stephen H. Dawson
>>> (865) 804-3454
>>> http://www.linkedin.com/in/shdcs
>>>
>>>
>>> On 06/06/2016 01:55 PM, Doug Stewart wrote:
>>>> On Mon, Jun 6, 2016 at 1:32 PM, Stephen H. Dawson
>>>> <address@hidden <mailto:address@hidden>> wrote:
>>>>
>>>>     Thank you, Isak. This spreadsheet interface greatly helps me.
>>>>
>>>>     I have now installed octave-io from distro repository. I am running
>>>>     octave via:
>>>>
>>>>     octave --force-gui
>>>>
>>>>     How does one load octave-io, please?
>>>>
>>>>
>>>> when you do
>>>> pkg list
>>>>
>>>> you should see a list of all the pkgs that have been installed'
>>>> If the is a * next to the pkg name then it is also loaded.
>>>>
>>>> to load a pkg type
>>>>
>>>> pkg load "pkgname"
>>>>
>>>> pkgname is the name in the list
>>>>
>>>>
>>>>
>>>>
>>>>  
>>>>
>>>>
>>>>     Thank You,
>>>>     Stephen H. Dawson
>>>>     (865) 804-3454 <tel:%28865%29%20804-3454>
>>>>     http://www.linkedin.com/in/shdcs
>>>>
>>>>
>>>>     On 06/05/2016 08:40 PM, Isak Delberth Davids wrote:
>>>>     > On 6 June 2016 at 00:31, Stephen H. Dawson <address@hidden
>>>>     <mailto:address@hidden>
>>>>     > <mailto:address@hidden <mailto:address@hidden>>> wrote:
>>>>     >
>>>>     >       x = [x1, x2, x3, ...];
>>>>     >       y = [y1, y2, y3, ...];
>>>>     >       z = [z1, z2, z3, ...];
>>>>     >
>>>>     >
>>>>     >     Yes, I think I see how to do this now. I will work in it
>>>>     over the next
>>>>     >     week and see where I end up.
>>>>     >
>>>>     >     I appreciate your kind assistance.
>>>>     >
>>>>     >     Thank You,
>>>>     >     Stephen H. Dawson
>>>>     >     (865) 804-3454
>>>>     >     http://www.linkedin.com/in/shdcs
>>>>     >
>>>>     >
>>>>     >     On 06/05/2016 06:25 PM, Mike Miller wrote:
>>>>     >     > On Sun, Jun 05, 2016 at 18:13:38 -0400, Stephen H. Dawson
>>>>     wrote:
>>>>     >     >> Catchy, nice functionally.
>>>>     >     >>
>>>>     >     >> Well, perhaps I am not asking my question properly. If I
>>>>     have 3
>>>>     >     columns
>>>>     >     >> in a spreadsheet of x, y, and z values, how do I enter
>>>>     those 3
>>>>     >     values
>>>>     >     >> for each location into the scatter3 function?
>>>>     >     >   x = [x1, x2, x3, ...];
>>>>     >     >   y = [y1, y2, y3, ...];
>>>>     >     >   z = [z1, z2, z3, ...];
>>>>     >     >   scatter3 (x, y, z);
>>>>     >     >
>>>>     >     > The demos generate random x, y, and z, but I think they pretty
>>>>     >     clearly
>>>>     >     > show how the coordinate vectors are passed to the function, as
>>>>     >     well as
>>>>     >     > how to pass additional arguments to set the size or color of
>>>>     >     each of the
>>>>     >     > points.
>>>>     >     >
>>>>     >     > It's the same as line plotting, the function takes in
>>>>     individual
>>>>     >     arrays
>>>>     >     > for each independent dimension of the plot. Corresponding
>>>>     values in
>>>>     >     > those arrays are the points of the line, histogram,
>>>>     scatter plot, or
>>>>     >     > surface that is being plotted.
>>>>     >     >
>>>>     >     > Is that what you are asking about?
>>>>     >     >
>>>>     >
>>>>     >
>>>>     >     _______________________________________________
>>>>     >     Help-octave mailing list
>>>>     >     address@hidden <mailto:address@hidden>
>>>>     <mailto:address@hidden <mailto:address@hidden>>
>>>>     >     https://lists.gnu.org/mailman/listinfo/help-octave
>>>>     >
>>>>     >
>>>>     > Hi,
>>>>     >
>>>>     > and since you mentioned "columns in a spreadsheet", this is how you
>>>>     > can read and use data from a spreadsheet.
>>>>     >
>>>>     > % reading spreadsheat
>>>>     > dataSet = xlsread('dataFile.xlsx')
>>>>     >
>>>>     > % extract individual columns one through three
>>>>     > x = dataSet(:,1)
>>>>     > y = dataSet(:,2)
>>>>     > z = dataSet(:,3)
>>>>     >
>>>>     > % plotting with data read from spreadsheet
>>>>     > scatter3(x, y, z);
>>>>     >
>>>>     > I think this requires that you have the octave-io package installed
>>>>     > and loaded.
>>>>     >
>>>>     > Cheers,
>>>>     > Isak Delberth DAVIDS
>>>>     >
>>>>
>>>>
>>>>     _______________________________________________
>>>>     Help-octave mailing list
>>>>     address@hidden <mailto:address@hidden>
>>>>     https://lists.gnu.org/mailman/listinfo/help-octave
>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>> DASCertificate for 206392
>>>>

Attachment: CubeGraphing.ods
Description: application/vnd.oasis.opendocument.spreadsheet

Attachment: scatter_plot_3D.m
Description: Text Data


reply via email to

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