MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How can I generate this graphic?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113588] Re: How can I generate this graphic?
  • From: "M.Roellig" <markus.roellig at googlemail.com>
  • Date: Wed, 3 Nov 2010 04:22:10 -0500 (EST)
  • References: <AANLkTi=tL4NB8=ObF1623NAFxuaekj415C5d2yC=u-aa@mail.gmail.com> <iar4oc$gpa$1@smc.vnet.net>

On 3 Nov., 08:59, Vicent <vgi... at gmail.com> wrote:
> Hello again.
>
> I've found a solution to the question I reported previously, using
> "ListContourPlot" function:
>
> DataFor Plotting = Table[myfunc[x, y], {x, 1, 20, 1}, {y, 1, 20, 1}]
>
> ListContourPlot[DataForPlotting, InterpolationOrder -> 0, ContourLabels ->
> All, PerformanceGoal -> "Quality"]
>
> I get this:http://dl.dropbox.com/u/155485/discrete_contour_plot_with_mathematica...
>
> As you can see, I don't get any contour labels. Moreover, I would like to
> know if the purple "square" that is located on the surface defined by the
> set [1 , 2] x [2 , 3] corresponds to the pair (x=1 ,  y=2) or (x= 2 , y=3),
> for example.
>
> So, given this solution, I still would need your advice regarding how to
> "tune" this graphic.
>
> Thank you very much in advance!!
>
> --
> Vicent
>
>
>
> On Tue, Nov 2, 2010 at 14:30, Vicent <vgi... at gmail.com> wrote:
> > Hello to all.
>
> > I want to make you a question about how to plot a specific graphic with
> > Mathematica 7.0.
>
> > I have a function  "myfunc"  defined on two discrete variables, say x  and
> >  y. And I want to represent graphically "myfunc".
>
> > I can generate some graphics with   ListPlot3D  and   ListContour Plot
> > that are close to what I want, but in both cases there is an interpolation,
> > which is OK but it is not necessary, and I would like to be able to generate
> > a graphic (2D or 3D) without any interpolation.
>
> > More precisely, I would like to generate a 2D graphic, the X and Y axis
> > representing the discrete variables  x  and  y,  respectively, with a
> > "point" (or "big square") for each integer combination of (x, y), the color
> > of the point being related with the value of  myfunc(x,y)  .  I mean, the
> > greater the value of   myfunc(x,y)  is, the lighter (or whatever) the color
> > of the associated point is. It would be like a kind of    "ListContourPlot",
> >  but without interpolating.
>
> > I have data arranged in this way:
>
> > DataForPlotting  =  Table[myfunc[x, y], {x, 1, 20, 1}, {y, 1, 20, 1}]
>
> > but of course I could do it in another way if necessary.
>
> > This is an image of what I want to achieve:
> >http://dl.dropbox.com/u/155485/discrete_contour_plot.png . In case you
> > can't access it, please let me know it.
>
> > I think it can be possible to build a graphic similar to that one with
> > Mathematica, but I am not sure of the easiest (or more logical or more
> > practical) way to do it, as I am just a beginner.
>
> > So, I would appreciate your help in this point.
>
> > Thank you very much in advance for your help!
>
> > --
> > Vicent Giner-Bosch- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Hi, just an example to get you going:

DataForPlotting = Table[Sin[x] y, {x, 1, 20, 1}, {y, 1, 20, 1}];
ListContourPlot[DataForPlotting, InterpolationOrder -> 0,
 ContourLabels -> All, PerformanceGoal -> "Quality", Mesh -> All,
 MeshStyle -> Directive[GrayLevel[0.2], Thickness[0.005]],
 ColorFunction -> (Blend[{Orange, Yellow, White}, #] &),
 FrameLabel -> {Style["x", Large, Italic, FontFamily -> "Arial"],
   Style[Rotate["y", -(\[Pi]/2)], Large, Italic,
    FontFamily -> "Arial"]}, FrameTicks -> None,
 PlotRangePadding -> 0]

Markus


  • Prev by Date: Re: Assertions in Mathematica?
  • Next by Date: command to save as .m file
  • Previous by thread: Re: How can I generate this graphic?
  • Next by thread: Re: How can I generate this graphic?