how to remove the gap between subsequent plots

Hello guys, I am trying to plot the a set of vectors (V) over of another set of vectors (O) in way similar to plotmatrix. I had a look on its source code at http://www-2.nersc.no/~even/matlab/toolbox/specgraph/plotmatrix.m but it was not very helpful. So, I decided to create my own version. I believe that I have nearly get there, but I miss two things. It is a figure of many subplots. See the picture: http://i289.photobucket.com/albums/ll232/veroulacs/untitled.png
  1. How can I remove the "gaps" between the plots? I have deleted the X and Y TickLabels by using set(gca,'YTickLabel','') and set(gca,'YTickLabel','') but my guess is that there exists some other type of object or margin between each plot. I want to make the assembly more compact.
  2. Although I specify the x and y axis range by using axis( [VARIABLES_LOWER(var) VARIABLES_UPPER(var) OBJECTIVES_LOWER(obj) OBJECTIVES_UPPER(obj)]); on EACH plot, matlab automatically uses different ticks for the axis, not the same ones with the aforementioned axis. I want the ticks to be set as the axis. E.g. plot (3,1), the range of xticks should be between 5500 and 6100
Any ideas/suggestions/recommendations are more than welcome and highly appreciated
Thanx for reading and your time C.T.

 Accepted Answer

1. Create custom axes, e.g.:
h1 = axes('Position',[0.1 0.1 0.4 0.4]);
h2 = axes('Position',[0.1 0.5 0.4 0.4]);
h3 = axes('Position',[0.5 0.5 0.4 0.4]);
h4 = axes('Position',[0.5 0.1 0.4 0.4]);
2. Set your ticks manually, e.g.:
set(h1,'XTickMode','manual');
set(h1,'XTick',[some_value some_larger_value]);,
For more information, please read the documentation on "Axes" and "Axes Properties".

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!