Thread Subject: Depth VS longtitude plot

Subject: Depth VS longtitude plot

From: nanxyzzz zhang

Date: 28 Oct, 2009 16:28:03

Message: 1 of 4


    Hi, everyone, i am new to matlab and I have a question.
    i want to make a contour plot, the x axis is longitude and the Y axis is the depth.
    The contour plot that i want to plot is 46*7 array.
    I created the axis like this:

   axesm('mercator','MapLonLimit',[-78.8 158])
   depth=[50 70 100 140 190 240]
 
     But I have no clue what i should do next. I tried to do it like

   contourf(axesm,depth,plot)

   but it does not work...... Can anyone give some clues?

                                 Thank you very much
                                                XX

Subject: Depth VS longtitude plot

From: NZTideMan

Date: 28 Oct, 2009 20:17:28

Message: 2 of 4

On Oct 29, 5:28 am, "nanxyzzz zhang" <littledd...@gmail.com> wrote:
>     Hi, everyone, i am new to matlab and I have a question.
>     i want to make a contour plot, the x axis is longitude and the Y axis is the depth.
>     The contour plot that i want to plot is 46*7 array.
>     I created the axis like this:
>
>    axesm('mercator','MapLonLimit',[-78.8 158])
>    depth=[50 70 100 140 190 240]
>
>      But I have no clue what i should do next. I tried to do it like
>
>    contourf(axesm,depth,plot)
>
>    but it does not work......  Can anyone give some clues?
>
>                                  Thank you very much
>                                                 XX

I assume your array is plot(46,7), correct?
This is a VERY BAD choice of variable name because plot is a
frequently-used function in Matlab, so next time you go to use it, you
will be screwed.
Apart from that, there are two reasons why it won't work:
1. Your depth has only 6 elements, where it should have 7 to match
plot(46,7)
2. You need to transpose the matrix plot, using plot' so that it has
dimensions 7x46

Subject: Depth VS longtitude plot

From: xiao

Date: 29 Oct, 2009 09:06:03

Message: 3 of 4

On Oct 28, 9:17 pm, NZTideMan <mul...@gmail.com> wrote:
> On Oct 29, 5:28 am, "nanxyzzz zhang" <littledd...@gmail.com> wrote:
>
>
>
> >     Hi, everyone, i am new to matlab and I have a question.
> >     i want to make a contour plot, the x axis is longitude and the Y axis is the depth.
> >     The contour plot that i want to plot is 46*7 array.
> >     I created the axis like this:
>
> >    axesm('mercator','MapLonLimit',[-78.8 158])
> >    depth=[50 70 100 140 190 240]
>
> >      But I have no clue what i should do next. I tried to do it like
>
> >    contourf(axesm,depth,plot)
>
> >    but it does not work......  Can anyone give some clues?
>
> >                                  Thank you very much
> >                                                 XX
>
> I assume your array is plot(46,7), correct?
> This is a VERY BAD choice of variable name because plot is a
> frequently-used function in Matlab, so next time you go to use it, you
> will be screwed.
> Apart from that, there are two reasons why it won't work:
> 1.  Your depth has only 6 elements, where it should have 7 to match
> plot(46,7)
> 2.  You need to transpose the matrix plot, using plot' so that it has
> dimensions 7x46






Thank you very much NZ, I transposed my depth array and renamed the
plot array to temperature.
But it looks it still does not work. When I try it like this:

contourf(axesm,depth,temperature)

it gave me the error:
??? Undefined function or method 'almanac' for input arguments of type
'char'.

Error in ==> axesmui>geoidupdate at 2724
    geoidvec(n+1,:) = almanac(planet,param);

Error in ==> axesmui>MainDialog at 228
        [ptr,list] = geoidupdate(mstruct.zone,mstruct.geoid);

Error in ==> axesmui at 109
        eval([callback,'(''',action,''')'])

Error in ==> axesmui at 62
            axesmui('MainDialog','AxesEntries')

Error in ==> axesm at 67
   cancelflag = axesmui;


Why is that? thank you very much

                              XX

Subject: Depth VS longtitude plot

From: NZTideMan

Date: 29 Oct, 2009 19:09:35

Message: 4 of 4

On Oct 29, 10:06 pm, xiao <littledd...@gmail.com> wrote:
> On Oct 28, 9:17 pm, NZTideMan <mul...@gmail.com> wrote:
>
>
>
> > On Oct 29, 5:28 am, "nanxyzzz zhang" <littledd...@gmail.com> wrote:
>
> > >     Hi, everyone, i am new to matlab and I have a question.
> > >     i want to make a contour plot, the x axis is longitude and the Y axis is the depth.
> > >     The contour plot that i want to plot is 46*7 array.
> > >     I created the axis like this:
>
> > >    axesm('mercator','MapLonLimit',[-78.8 158])
> > >    depth=[50 70 100 140 190 240]
>
> > >      But I have no clue what i should do next. I tried to do it like
>
> > >    contourf(axesm,depth,plot)
>
> > >    but it does not work......  Can anyone give some clues?
>
> > >                                  Thank you very much
> > >                                                 XX
>
> > I assume your array is plot(46,7), correct?
> > This is a VERY BAD choice of variable name because plot is a
> > frequently-used function in Matlab, so next time you go to use it, you
> > will be screwed.
> > Apart from that, there are two reasons why it won't work:
> > 1.  Your depth has only 6 elements, where it should have 7 to match
> > plot(46,7)
> > 2.  You need to transpose the matrix plot, using plot' so that it has
> > dimensions 7x46
>
> Thank you very much NZ, I transposed my depth array and renamed the
> plot array to temperature.
> But it looks it still does not work. When I try it like this:
>
> contourf(axesm,depth,temperature)
>
> it gave me the error:
> ??? Undefined function or method 'almanac' for input arguments of type
> 'char'.
>
> Error in ==> axesmui>geoidupdate at 2724
>     geoidvec(n+1,:) = almanac(planet,param);
>
> Error in ==> axesmui>MainDialog at 228
>         [ptr,list] = geoidupdate(mstruct.zone,mstruct.geoid);
>
> Error in ==> axesmui at 109
>         eval([callback,'(''',action,''')'])
>
> Error in ==> axesmui at 62
>             axesmui('MainDialog','AxesEntries')
>
> Error in ==> axesm at 67
>    cancelflag = axesmui;
>
> Why is that? thank you very much
>
>                               XX

No, it's not contourf that's giving you that error, it's axesm.
I don't have that in my version of Matlab, so I can't help you.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com