Rectangle with Scaled (a plot inside a plot)

Discussion in 'Mathematica' started by dimitris, Nov 17, 2006.

  1. dimitris

    dimitris Guest

    Consider the following setting...

    sampledpoints = {};

    ff[(x_)?InexactNumberQ] := (AppendTo[sampledpoints, x]; 1.)

    NIntegrate[ff[x]*BesselJ[0, x], {x, 0, Infinity}, Method ->


    ListPlot[sampledpoints, ImageSize -> 400, Frame -> {True, True, False,
    False}, Axes -> False,
    PlotLabel -> "sampled points by NIntegrate, Method:Oscillatory",
    FrameTicks -> {Range[0, 4000, 500], Range[0, 100, 5*Pi]},
    Epilog -> Rectangle[{1500, 10}, {3000, 100},
    ListPlot[Cases[sampledpoints, x_ /; 0 <= x <= Pi],
    PlotStyle -> {Blue, PointSize[0.04]}, Frame -> {True, True, False,
    False}, Axes -> False, DisplayFunction -> Identity,
    FrameTicks -> {Range[0, 50, 10], Range[0, Pi, Pi/4]}]]]

    I tried very hard to get the plot inside the plot in a visible
    How is it possible this without the need of specifying explicitly
    {xmin,ymin}, {xmax,ymax} coordinates in Rectangle?
    I did some attempts with Scaled but all failed.

    Any help will be greatly appreciate.

    dimitris, Nov 17, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.