Message Boards Message Boards

Make a ListContourPlot from a dataset?

Posted 8 years ago

Hi,

I created a discussion of asking help how to create a contour plot. but it was removed by the moderator telling that i was an easy question to ask for help, I however find this a bit rude. As a beginner, unfortunately not much information exists when having specific questions, especially in my case when i wanted to make a contour plot with a data set...

I I tried running this code as an example just to understand how contour plot works and I simply get an empty box and don't understand why..,

data = {{0.0003, 0.0003, 0.2}, {0.001, 0.0003, 0.7}, {0.002, 0.0003, 
   0.11}, {0.002, 0.0003, 0.11}, {0.003, 0.0003, 0.14}}

ListContourPlot[data, Contours -> 20, AspectRatio -> Automatic, 
 PlotRange -> {{0.0003, 0.003}, {0.0003, 0.003}}, 
 ContourLabels -> All, FrameLabel -> {"KMO", "KSO"}, 
 Background -> White, LabelStyle -> Directive[Black, Bold]]

Any help in this aspect would be of a great use to me

Thanks in advance

Attachments:
5 Replies

The answer given by Frank is not the answer. Both the 3D and the normal version should work with '3d' data. The problem is that all the points are on a single line, so you can not create a surface:

Graphics[data[[All, ;; 2]] // Point, AspectRatio -> 1, Frame -> True]

enter image description here

POSTED BY: Sander Huisman

Thanks a lot for your reponse! is there also any possibility to label those points? for example..in the data i have..{0.0003, 0.0003, 0.2} which means i would like to label the intercept point of 0.0003 and 0.0003 as 0.2..

You could try something like:

coors=data[[All,;;2]];
labels=data[[All,3]];
Graphics[{
        Point[coors],
        MapThread[Text[#1,#2,{0,-1}]&,{labels,coors}]
    },
    AspectRatio->1,
    Frame->True,
    PlotRangePadding->Scaled[.05],
    PlotRange->{{0.0003,0.003},{0.0003,0.003}}
]
POSTED BY: Sander Huisman

The question was "how to do a contour plot". Perhaps the question was phrased wrong.

POSTED BY: Frank Kampas

You didn't provide a function of the data points to generate contours. Also, for 3 dimensional data, you want ListContourPlot3D.

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract