Home » Misc » Maniuplate EPS figures …

Maniuplate EPS figures generated by Matlab

Open the eps file with a text editor, such as vim.

Change the text

This is the most straight forward task, just search for the text and replace it with the one you need.

Change the line colour

There is a colour table in the eps file generated by Matlab. Search for “Colortable” and you'll find it. The following is an example

86 dict begin %Colortable dictionary
/c0 { 0.000000 0.000000 0.000000 sr} bdef
/c1 { 1.000000 1.000000 1.000000 sr} bdef
/c2 { 0.900000 0.000000 0.000000 sr} bdef
/c3 { 0.000000 0.820000 0.000000 sr} bdef
/c4 { 0.000000 0.000000 0.800000 sr} bdef
/c5 { 0.910000 0.820000 0.320000 sr} bdef
/c6 { 1.000000 0.260000 0.820000 sr} bdef
/c7 { 0.000000 0.820000 0.820000 sr} bdef

You can either modify this colour table, or replace a colour with another by simply searching the occurrence of it.

Change the line style

Search for “line types” in the eps file, probably you can find the definition of styles like solid, dotted, dashed, etc.

/SO { [] 0 setdash } bdef
/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
/DA { [6 dpi2point mul] 0 setdash } bdef
/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4
  dpi2point mul] 0 setdash } bdef

Search for the line style to be replaced, e.g. SO, and replace it with another type you want.

— Last modified: xiaoke 2013/10/09 22:41