Tuesday, July 8, 2014

Freemat Plotting

Freemat plotting is very easy. Its just like plot(x,y) and it will plot it .
There are some attribute you can add to this plot
like
1. Plot it like line or scatter plot

Line Plot
--------------------------------------------------------------------------------------------------
plot(x,y)

Scatter Plot
---------------------------------------------------------------------------------------------------
plot (x,y,'*')

You can use most of the symbol for representation of the points in the plot.

2.Set min max of the axis

axis ([xmin xmax ymin ymax])

so give the values in that order inside the [] and then within ()

3. Reverse axis

set(gca,'XDir','reverse') or the YDir

4. Colour

For colour just write the code like
plot(x,y,'g')

'g' - represent green.

Few short forms are

  • 'b' - Color Blue
  • 'g' - Color Green
  • 'r' - Color Red
  • 'c' - Color Cyan
  • 'm' - Color Magenta
  • 'y' - Color Yellow
  • 'k' - Color Black
The symbolspec specifies the (optional) symbol to be drawn at each data point:
  • '.' - Dot symbol
  • 'o' - Circle symbol
  • 'x' - Times symbol
  • '+' - Plus symbol
  • '*' - Asterisk symbol
  • 's' - Square symbol
  • 'd' - Diamond symbol
  • 'v' - Downward-pointing triangle symbol
  • '^' - Upward-pointing triangle symbol
  • '<' - Left-pointing triangle symbol
  • '>' - Right-pointing triangle symbol
The linestylespec specifies the (optional) line style to use for each data series:
  • '-' - Solid line style
  • ':' - Dotted line style
  • '-.' - Dot-Dash-Dot-Dash line style
  • '--' - Dashed line style