Editing Recap of the hierarchy of each plot element
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
Octave aims at being compatible with Matlab as much as possible, so the graphics part is very similar too to Matlab. In Octave the first choice to make is the {{Codeline|graphics_toolkit ()}}. | First of all, Octave aims at being compatible with Matlab (TM) as much as possible, so the graphics part is very similar too to Matlab. In Octave the first choice to make is the {{Codeline|graphics_toolkit()}}. Standard is the 'gnuplot' toolkit using the [http://www.gnuplot.info Gnuplot] software package . The second choice is 'fltk' [http://www.fltk.org fltk]. You might want to try to test both of them for your plotting aims to see which solves your problem. | ||
You might want to try to test | |||
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) | |||
- gcf() (the handle to your figure: one for every figure) | |||
- gca() (the handle to the axes inside a figure (several if you have subplots) | |||
- p=plot(x,y) (p is the handle to the data, data symbols, data line thickness, etc) | |||
Let's do an example: | |||
graphics_toolkit('gnuplot'); | |||
x=0:0.1:3; | |||
y=sin(x); | |||
p=plot(x,y,'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'}}). | 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'}}). | ||