S L
S L

Reputation: 14328

making axes distinct from other grid

Does anyone know how to make x-axis and y-axis look a bit bolder or somehow distinct from other grids? enter image description here

Somehow I want it to look like this enter image description here

Upvotes: 2

Views: 172

Answers (2)

Dang Khoa
Dang Khoa

Reputation: 5823

Check out hline and vline from the MATLAB File Exchange. It will let you draw horizontal and vertical lines at any given point and extend those lines to infinity (so redoing axes will still keep the lines drawn all the away across your plot). If you need to draw to specific handles, here's an advanced hline/vline.

Upvotes: 1

Andrey Rubshtein
Andrey Rubshtein

Reputation: 20915

The stupidest thing I can think of is drawing a line with LineWidth = 2

figure();
plot([0 0],[-200 200],'LineWidth',2,'Color',[0 0 0])
hold on;plot([-200 200],[0 0],'LineWidth',2,'Color',[0 0 0])

Though it has some obvious disadvantages, like that it ends at some place.

Upvotes: 3

Related Questions