Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Plots: problem with ticks and legend

Subject: Plots: problem with ticks and legend

From: Zeineb

Date: 6 Dec, 2012 17:34:08

Message: 1 of 2

Hello,

First I wanted to know if there was a way to use crossing ticks on Matlab plots? (I only found in and out ticks, for now).
Also, is it possible to keep ticks on the x and y axis, but remove them from the top and bottom axis (while keeping the box)?

Finally I have a problem with a function I used to be able to move the legend, but I still have no idea of how to fix it.
Here are the function and the variables:

%
afStartingPoint_FU(1) = (afStartingPoint(1) - afXAxisLimits(1) )/ (afXAxisLimits(2) - afXAxisLimits(1) )* fXAxisLength + fXAxisPosition;
afStartingPoint_FU(2) = (afStartingPoint(2) - afYAxisLimits(1) )/ (afYAxisLimits(2) - afYAxisLimits(1) )* fYAxisLength + fYAxisPosition;
afEndingPoint_FU(1) = (afEndingPoint(1) - afXAxisLimits(1) )/ (afXAxisLimits(2) - afXAxisLimits(1) )* fXAxisLength + fXAxisPosition;
afEndingPoint_FU(2) = (afEndingPoint(2) - afYAxisLimits(1) )/ (afYAxisLimits(2) - afYAxisLimits(1) )* fYAxisLength + fYAxisPosition;
%
handleToAnnotation1 = annotation( ...
     strAnnotationType, ...
    [afStartingPoint_FU(1) afEndingPoint_FU(1)], ...
    [afStartingPoint_FU(2) afEndingPoint_FU(2)]) ;


Thanks a lot for your help!!

Subject: Plots: problem with ticks and legend

From: dpb

Date: 6 Dec, 2012 20:46:36

Message: 2 of 2

On 12/6/2012 11:34 AM, Zeineb wrote:
> Hello,
> First I wanted to know if there was a way to use crossing ticks on
> Matlab plots? (I only found in and out ticks, for now).

That's it...it's a bipolar flag...

> Also, is it possible to keep ticks on the x and y axis, but remove them
> from the top and bottom axis (while keeping the box)?

Again, nope...that level of detail isn't controllable. You could
simulate it by drawing the box top/right sides w/ line()

> Finally I have a problem with a function I used to be able to move the
> legend, but I still have no idea of how to fix it.
...

What, specfically, are you trying to fix?

My version predates annotation() so maybe I won't know what to tell you
anyway, but at this point not sure what the question is, even.

--

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us