Changes

Jump to navigation Jump to search
no edit summary
Line 3: Line 3:  
After the choice of the {{Codeline|graphics_toolkit('gnuplot')}} or {{Codeline|graphics_toolkit('fltk')}}, there is the following hierarchy to address when make/adapting your plot:
 
After the choice of the {{Codeline|graphics_toolkit('gnuplot')}} or {{Codeline|graphics_toolkit('fltk')}}, there is the following hierarchy to address when make/adapting your plot:
   −
- root  (any hierarchy needs to start somewhere)
+
* root  (any hierarchy needs to start somewhere)
- gcf() (the handle to your figure: one for every figure)
+
* gcf() (the handle to your figure: one for every figure)
- gca() (the handle to the axes inside a figure (several if you have subplots)  
+
* gca() (the handle to the axes inside a particular figure (several if you have subplots)  
- p=plot(x,y) (p is the handle to the data, data symbols, data line thickness, etc)
+
* p=plot(x,y) (p is the handle (inside the current axes handle) to the data, data symbols, data line thickness, etc)
    
Let's do an example:
 
Let's do an example:
Line 16: Line 16:     
This should get you a plot of a part of a sine wave. Octave has used all standard properties like line widths, fonts, etc, except for the line color which was forced to be blue (via the {{Codeline|'b'}}).
 
This should get you a plot of a part of a sine wave. Octave has used all standard properties like line widths, fonts, etc, except for the line color which was forced to be blue (via the {{Codeline|'b'}}).
 +
 +
Before going into the hierarchy and how to change things, let's make things more complicated:
 +
 +
graphics_toolkit('gnuplot');
 +
figure(1)
 +
x=0:0.1:3;
 +
y=sin(x);
 +
p=plot(x,y,'b');
 +
figure(2)
 +
subplot(2,1,1);
 +
r=plot(x,y.^2,'og');
 +
subplot(2,1,2);
 +
q=plot(x,x.^2,'k');
 +
 +
* You now have 2 windows that popped up on your screen: figure1 and figure2.
 +
* figure2 has 2 axes objects inside: a 'y=(sin(x))^2' and a 'y=x^2'
 +
* the actual data and data-plot-properties are inside the handles {{Codeline|p}} and {{Codeline|r}}.
22

edits

Navigation menu