[Date Index]
[Thread Index]
[Author Index]
Re: Having difficulties improving Legend and plot
*To*: mathgroup at smc.vnet.net
*Subject*: [mg131460] Re: Having difficulties improving Legend and plot
*From*: Bob Hanlon <hanlonr357 at gmail.com>
*Date*: Sat, 27 Jul 2013 05:39:14 -0400 (EDT)
*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com
*Delivered-to*: l-mathgroup@wolfram.com
*Delivered-to*: mathgroup-outx@smc.vnet.net
*Delivered-to*: mathgroup-newsendx@smc.vnet.net
*References*: <20130726094654.4DE236A58@smc.vnet.net>
I just noticed that you incremented n by two so that the x axis does not
align with n. Just include the n values in the table.
$Version
"8.0 for Mac OS X x86 (64-bit) (October 5, 2011)"
Needs["PlotLegends`"];
funcs = Table[
{n, A ((Log[n] - 1)/(Log[n] + 1))},
{A, 1000, 300, -100},
{n, 4, 2000, 2}];
ListLinePlot[funcs,
Frame -> True,
Axes -> False,
FrameLabel -> (Style[#, 14] & /@
TraditionalForm /@ {n, f[A, n]}),
PlotStyle -> ({AbsoluteThickness[2], #} & /@
{Yellow, Red, Blue, Green,
Orange, White, Black, Brown}), PlotLegend -> Range[1000, 300, -100],
LegendLabel -> Style["Constant A", 12],
LegendLabelSpace -> 1,
LegendSpacing -> 0.01,
ImageSize -> 800,
LegendSize -> 1.0,
LegendPosition -> {1.025, -0.225},
ShadowBackground -> GrayLevel[.75],
LegendBackground -> LightPurple,
Background -> LightGray,
Epilog -> Text[Style[
f[A , n] == A ((Log[n] - 1)/(Log[n] + 1)) //
TraditionalForm,
14], {1000, 100}]]
Bob Hanlon
On Fri, Jul 26, 2013 at 11:35 AM, Bob Hanlon <hanlonr357 at gmail.com> wrote:
> You are apparently not running the current version of Mathematica (v9). I
> will use v8.
>
>
> $Version
>
>
> "8.0 for Mac OS X x86 (64-bit) (October 5, 2011)"
>
>
> Needs["PlotLegends`"];
>
>
> Note that nested tables can be written as a single table with mutiple
> iterators:
>
>
> funcs = Table[
>
> A ((Log[n] - 1)/(Log[n] + 1)),
> {A, 300, 1000, 100},
> {n, 4, 2000, 2}];
>
>
> You used an unnecessarily complicated method to reverse the order of the
> functions:
>
>
> {Sequence @@ (funcs[[#1]] &) /@
> {8, 7, 6, 5, 4, 3, 2, 1}} ==
> (funcs[[#]] & /@ {8, 7, 6, 5, 4, 3, 2, 1}) ==
> Reverse[funcs]
>
>
> True
>
>
> Alternatively, you could just decrement the table iterator: {A, 1000,
> 300, -100)
>
>
> To smooth the plot, use lines rather than numerous PlotMarkers. Either add
> the option Joined->True or use ListLinePlot rather than ListPlot. Either of
> these will also use lines for the legends. Lines are easier to see than
> just PlotMarkers and the lines will be the same thickness as the plot lines.
>
> If you are going to use a legend shadow, I recommend that you tone it down
> by using a lighter shade of gray.
>
>
> ListLinePlot[Reverse[funcs],
> Frame -> True,
> Axes -> False,
> FrameLabel -> (Style[#, 14] & /@
> TraditionalForm /@ {n, f[A, n]}),
> PlotStyle -> ({AbsoluteThickness[2], #} & /@
> {Yellow, Red, Blue, Green,
> Orange, White, Black, Brown}), PlotLegend -> Range[1000, 300, -100],
> LegendLabel -> Style["Constant A", 12],
>
> LegendLabelSpace -> 1,
> LegendSpacing -> 0.01,
> ImageSize -> 800,
> LegendSize -> 1.0,
> LegendPosition -> {1.025, -0.225},
> ShadowBackground -> GrayLevel[.75],
> LegendBackground -> LightPurple,
> Background -> LightGray,
> Epilog -> Text[Style[
> f[A , n] == A ((Log[n] - 1)/(Log[n] + 1)) //
> TraditionalForm,
> 14], {500, 100}]]
>
>
>
> Bob Hanlon
>
>
>
>
> On Fri, Jul 26, 2013 at 5:46 AM, Gilmar Rodriguez-pierluissi <
> peacenova at yahoo.com> wrote:
>
>>
>> Dear Math Group:
>>
>> I'm having difficulties improving the following plot:
>>
>> Needs["PlotLegends`"];
>>
>> funcs = Table[Table[A ((Log[n] - 1)/(Log[n] + 1)), {n, 4, 2000, 2}], {A,
>> 300, 1000, 100}];
>>
>> ListPlot[{Sequence @@ (funcs[[#1]] &) /@ {8, 7, 6, 5, 4, 3, 2, 1}},
>> PlotStyle -> {Yellow, Red, Blue, Green, Orange, White, Black, Brown},
>> PlotLegend -> {"1000", "900", "800", "700", "600", "500", "400", "300"},
>> LegendLabel -> "Constant A",
>> LegendLabelSpace -> 1,
>> LegendSpacing -> 0.01,
>> ImageSize -> 800,
>> LegendSize -> 1.0,
>> LegendPosition -> {1.15, -0.25},
>> ShadowBackground -> Gray,
>> LegendBackground -> LightPurple,
>> Background -> LightGray]
>>
>> (1.) The smooth function curves look serrated in the plot.
>>
>> (2.) When one attempts to add the option: "PlotMarkers->Automatic"; the
>> ListPlot program malfunctions.
>>
>> (3.) I also want to increase the size of the markers in the Legend but,
>> there doesn't seem to be an option
>> available to accomplish this.
>>
>> Please, help me to improve this plot. Thanks!
>>
>> Gilmar Rodr=EDguez-Pierluissi
>> peacenova at yahoo.com
>>
>>
>
Prev by Date:
**Re: "Complement" to the Risch Algorithm**
Next by Date:
**Re: CUDAFunctionLoad error with windows 7 64 bits**
Previous by thread:
**Re: Having difficulties improving Legend and plot**
Next by thread:
**ensuring that instructions are performed sequentially**
| |