Question:

Matlab plot modify linewidth, marker size question?

by  |  earlier

0 LIKES UnLike

I know how to do it my click hundred of buttons. How can I change the line width , marker size by a few command lines?

I see the lineseries function on the web, but I am not sure how to use it. I don't know how to use handler in Matlab

Assume I don't know whether I have marker on the graph; and I l don't know how many lines are on the graph. I need to change the size of the marker and the linewidth. What to do?

Thanks ahead

 Tags:

   Report

1 ANSWERS


  1. When you draw things in matlab, most routines return a handle to the objects that were drawn. You can then set any number of properties on the drawn objects via this handle.

    For example, I can do this to change the line width of a plot:

    x = -1:0.01:1;

    y = acos(x);

    figure;

    hand = plot(x, y);

    set(hand, 'LineWidth', 4);

    For changing the marker size, you'd do

    hand = plot(x, y, 'r.');

    set(hand, 'MarkerSize', 30);

    To change font properties of an axis label:

    hand = xlabel('My Label');

    set(hand, 'FontSize', 20);

    set(hand, 'FontWeight', 'bold');

    In general, you can get all the possible properties of an object by calling set(hand); on its handle.

    Hope that helps.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.