MathGroup Archive 2003

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

Search the Archive

RE: RE: Where have all the axes gone?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg41015] RE: [mg40964] RE: [mg40917] Where have all the axes gone?
  • From: Bobby Treat <drmajorbob+MathGroup3528 at mailblocks.com>
  • Date: Tue, 29 Apr 2003 05:22:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hartmut,

I copied and pasted your code into a notebook and again found the two graphs very different.  On a hunch, I changed Magnification to 100% (I usually use 150%), reevaluated, and the charts looked the same except for axes -- almost.  In both cases, the Show result is shifted to the left compared to the Plot.  At 150% magnification there's a significant difference in the shape of the red region, but at 100% the shapes are the same.  The alignment shift is about 10% of the graph's width using 150% magnification, and about 15% using 100% magnification.

Odder still, I decided to print the 150% version to a PDF file to show you the difference in shape, but in the PDF file, the outputs match each other there.  Both are shaped like the onscreen Show output, but horizontal alignment is like the onscreen Plot output.

Printing the 100% magnification example gives identical results.  But the onscreen shape at 100% doesn't match the shape that's printed to a PDF.

These are very strange WYSIWYG failures / rendering errors.

I'm using version 4.2.1 under WinXP, with an ATI Radeon 8500LE video card.

Bobby

-----Original Message-----
From: Wolf, Hartmut <Hartmut.Wolf at t-systems.com>
To: mathgroup at smc.vnet.net
Subject: [mg41015] RE: [mg40964] RE: [mg40917] Where have all the axes gone?

Bobby,

I quite don't catch on what you wanted to express. But, yes, there are
differences between the proposed two methods to bring the axes to the front.
As far as I see -- or guess, say better -- this is caused by the use of
FullOptions (or AbsoluteOptions) in the package FilledPlot (modified Show
that is) when displaying the graphics with AxesFront -> True.

 
In[1]:= $Version   (* my Version *)
Out[1]= "4.1 for Microsoft Windows (November 2, 2000)"

In[2]:=
g0 = Plot[Exp[-2x^2], {x, -5, 5}, PlotRange -> All, 
      PlotStyle -> {RGBColor[1, 0, 0], Thickness[0.2]}, Axes -> True];

In[3]:= g1 = Show[FullGraphics[g0], Options[g0]]

To my eye g1 is the same as g0, except for g0 having the axes hidden, but g1
visible. This is what should be in first place!


In[4]:= << Graphics`FilledPlot`
In[5]:=
gaxf = Show[g0, AxesFront -> True]

Here obviously the PlotRegion is cut, parts from (the very thick) plotted
line below and above are missing)

This is very similar -- though not a 100% identical -- to 

In[6]:= Show[g1, AbsoluteOptions[g1, PlotRange]]


Now, I recollect vaguely, that the calculation of AbsoluteOptions does not
account for the Thickness of the Lines drawn (whereas Show[...,
PlotRange->All] does).


To compare the minor differences of these plots see:

In[7]:= opt1 = AbsoluteOptions[g1];
In[8]:= optaxf = AbsoluteOptions[gaxf];

In[9]:= AxesFront /. {opt1, optaxf}
Out[9]= {False, True}

Of course!

In[10]:= PlotRange /. {opt1, optaxf}
Out[10]= 
{{{-5.5125, 5.5125}, {-0.05125, 1.05125}},
 {{-5.25, 5.25}, {-0.025, 1.025}}}

Perhaps due to some "adjustment" made in modified Show, due to the known
discrepancy mentioned.

This follows:

In[11]:=
Dimensions /@ ({ticks1, ticksaxf} = Ticks /. {opt1, optaxf})
Out[11]= {{2, 23, 4}, {2, 21, 4}}

In[12]:=
Complement @@ ReleaseHold[Hold[Ticks[[2, All, All]]] /. {opt1, optaxf}]
Out[12]=
{{-0.05, "", {0.00375, 0.}, {GrayLevel[0.], AbsoluteThickness[0.125]}},
 {1.05, "", {0.00375, 0.}, {GrayLevel[0.], AbsoluteThickness[0.125]}}}


Some manual experimenting brings me to

In[43]:=
Show[gaxf, PlotRange -> {{-5.7, 5.7}, {-0.2, 1.15}}]

as being close to the original Plot, now with Axes shown (but longer as
original).


(You may observe some perversity, if you like, gradually changing the
maximum PlotRange of y-direction. But those things are well know either.)

It's difficult to give the user a recommendation; at least, there is a
choice.

--
Hartmut Wolf



>-----Original Message-----
>From: Bobby Treat [mailto:drmajorbob+MathGroup3528 at mailblocks.com]
To: mathgroup at smc.vnet.net
>Sent: Friday, April 25, 2003 8:12 PM
>To: Hartmut.Wolf at t-systems.com; mathgroup at smc.vnet.net
>Subject: [mg41015] Re: [mg40964] RE: [mg40917] Where have all the axes gone?
>
>
>Yes, but -- on my machine anyway -- the second plot is shaped very 
>different from the first.  (A bit obscene, perhaps.)
>
>(Version 4.2.1)
>
>Plot[Exp[-2x^2], {x, -5, 5}, PlotRange -> All,
>      PlotStyle -> {RGBColor[1, 0, 0],
>      Thickness[0.2]}, Axes -> True ];
>
>Show[FullGraphics[%], Options[%]]
>
>Bobby
>
>-----Original Message-----
>From: Wolf, Hartmut <Hartmut.Wolf at t-systems.com>
To: mathgroup at smc.vnet.net
>To: mathgroup at smc.vnet.net
>Sent: Fri, 25 Apr 2003 08:07:50 -0400 (EDT)
>Subject: [mg41015] [mg40964] RE: [mg40917] Where have all the axes gone?
>
>
>>-----Original Message-----
>>From: Pavel Pokorny [mailto:Pavel.Pokorny at vscht.cz]
To: mathgroup at smc.vnet.net
>To: mathgroup at smc.vnet.net
>>Sent: Thursday, April 24, 2003 11:26 AM
>>To: mathgroup at smc.vnet.net
>>Subject: [mg41015] [mg40964] [mg40917] Where have all the axes gone?
>>
>>
>>Motto:
>>
>>   Plot[Exp[-2x^2],{x,-5,5},
>>     PlotRange->All,
>>     PlotStyle->{RGBColor[1,0,0],Thickness[0.2]},
>>     Axes ->True
>>   ];
>>
>>Can you, please, help me to redraw the axes?
>>Something with Epilog?
>>I feel there is a simple solution I can't see.
>>
>>Any help appreciated.
>>
>>--
>>Pavel Pokorny
>>Math Dept, Prague Institute of Chemical Technology
>>http://staffold.vscht.cz/mat/Pavel.Pokorny
>>
>
>Pavel,
>
>In[2]:= << Graphics`FilledPlot`
>In[3]:= Show[%%, AxesFront -> True]
>
>brings them back by witchcraft. Well, the reason is, the package 
>modifies
>Show to give it that convenient option AxesFront. Details can be found
>there.
>
>Also this simple concept works (even when package FilledPlot has not 
>been
>loaded):
>
>In[4]:= Show[FullGraphics[%%%], Options[%%%]]
>
>
>The explanation is simple: (normally, when FilledPlot not loaded) Show 
>draws
>Axes first, and then the Graphics. FullGraphics however 
>contains all the
>embellishments in Form of graphics elements, luckily after the 
>graphics 
>from
>the contents, such the Axes are redrawn and visible.
>
>
>--
>Hartmut Wolf
>


  • Prev by Date: Re: Re: Re: Condition/constraint problem
  • Next by Date: Re: Re: Re: Condition/constraint problem
  • Previous by thread: RE: RE: Where have all the axes gone?
  • Next by thread: RE: RE: Where have all the axes gone?