Hi, Sorry I am new here, I will like to know how to plot pointers/markers within a line? (Through programming code) I am able to plot a line just that I could not plot pointers on the line. Is there a command to plot every pointer within 0.5 difference?
Thanks.

2 Kommentare

the cyclist
the cyclist am 15 Jan. 2012
I don't quite understand the part of your question about 0.5 difference. Can you explain that a bit more?
Casey
Casey am 16 Jan. 2012
erm, for example a line from (0-10) in between got markers of 0.5.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

the cyclist
the cyclist am 15 Jan. 2012

0 Stimmen

There are a couple ways. Here's a simple one:
figure
plot(1:10,'.-');
"doc plot" will give you info on the different choices for marker and line styles.
Slightly more complicated, but worth learning, is how to manipulate the properties of the line after you have plotted it. Here is an example:
figure
h = plot(1:10);
set(h,'Marker','square')
You can achieve control over nearly ever aspect of your plots when you know how to use "handle graphics", which is the term for these manipulations.
Here is a longer document that goes into great detail about how to use handle graphics: http://www.mathworks.com/support/tech-notes/1200/1205.html

3 Kommentare

Casey
Casey am 16 Jan. 2012
What if I want to plot a horizontal line with markers is it possible?
Is it I have to make an array of numbers?
example: [0,2,4,6.....]
Is that the only way?
Thanks alot for the previous information.
Walter Roberson
Walter Roberson am 16 Jan. 2012
y_height = pi; %for example;
x = 0 : 0.5 : 10;
y = y_height + zeros(size(x)); %zeros() to make it the same size
plot(x,y,'.-');
Casey
Casey am 16 Jan. 2012
Thanks.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by