Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Mathematica7 doesn't copy/paste metafile in vector format

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104375] Re: Mathematica7 doesn't copy/paste metafile in vector format
  • From: Harrie Kraai <hakraai at xs4all.nl>
  • Date: Thu, 29 Oct 2009 02:59:04 -0500 (EST)
  • References: <hc0n2d$a2n$1@smc.vnet.net> <hc38j8$i95$1@smc.vnet.net>

Hi guys, I may add a bit to this conversation. Sometimes simple measures 
may do the trick, for example for a ContourPlot:

cpl=ContourPlot[Sin[x]Sin[y],{x,0,Pi},{y,0,Pi}]

this gives a graphic that cannot be handled in the EMF vector format 
that is used by copy/paste on Windows.
However, it turns out that the only problem is the use of the Opacity 
directive automatically used for the contour lines.

newcpl=cpl/.{Opacity[_]->Sequence[]}

will give you a graphic that does Copy/Paste as a vector format. In this 
case it is not even necessary to remove Tooltips (using 
Tooltip[a_,__]:>a), but it may be in other cases.

Ok, the result looks slightly different (lines a bit blacker), but that 
may be compensated by changing the ContourStyle.
In fact, choosing an explicit ContourStyle->{GrayLevel[0.2]} prevents 
the whole Opacity issue.

Looking at the InputForm of other graphics may give you more clues as to 
which parts should be removed before copy/paste.

Best wishes,

Harrie


Lawrence Teo wrote:
> Hi John,
> 
> Really thanks for your explanation and the reasons behind the decision
> of change.
> If it were in the Mathematica documentation, it would be excellent.
> 
> I just want to highlight in one sentence on your suggestion which
> works for me.
> 
> << Version5`Graphics`
> before plot commands to get older vector metafile as found in
> Mathematica 5.2
> 
> This method allows me to regain the older Mathematica way to generate
> vector metafile.
> Hope it will help other Mathematica users when they run into the same
> questions.
> 
> Thanks again, John.
> 
> Lawrence
> 
> 
> On Oct 25, 1:18 pm, John Fultz <jfu... at wolfram.com> wrote:
>> On Sat, 24 Oct 2009 02:37:26 -0400 (EDT), Lawrence Teo wrote:
>>> Hi John,
>>> Thanks for the suggestion.
>>> While it is possible to export to bitmap with high enough resolution,
>>> is there any other way for us to specify how we would want Mathematica
>>> 7 handle Metafile in vector or raster? After all, that is the main
>>> reason we have the two options of Copy As > Metafile and Copy As >
>>> Bitmap at the same time, I thought?
>> Yes, but the point is that, unless the metafile is a bitmap in these case=
> ,=
>>  it
>> will not look at all like what you see onscreen.  Surely something whic=
> h
>> fundamentally changes the appearance of a graphic for the worse is=
>>  unacceptable
>> behavior.  But for many other graphics, as you've discovered, metafile =
> does=
>> preserve a vector representation.  It is superior to bitmap in some cas=
> es,
>> equivalent in others.  The best compromise we could come up with for fi=
> le
>> formats which were designed around 1990 and 1995 respectively (for Window=
> s=
>>  and
>> Enhanced variants of the metafile format...my dates might be slightly off=
> ,=
>>  but
>> are about right).
>>
>>> I have Mathematica 7 and Mathematica 5.2 on Windows Vista. I have to
>>> revert back to Mathematica 5.2 when it comes to vector metafile.
>>> What I can't fully understand is, why on the same Windows Vista,
>>> Mathematica 5.2 doesn't have the problem of inability of supporting
>>> high fidelity vector representation, as Mathematica 7 faces?
>> There was a sea change in the quality of graphics between 5.2 and 7.  I=
> f=
>>  you're
>> willing to live with the graphics technology that we created in the 1990s=
> ,=
>>  you
>> can run it in version 7 by evaluating...
>>
>> << Version5`Graphics`
>>
>> before evaluating your plot commands.  You'll get static, non-interacti=
> ve
>> graphics (the first thing you'll notice is that you can't rotate the 3D
>> graphics) with all of the best features we designed in the 90s, and they=
> =
>>  live
>> completely within the limitations of the metafile format.
>>
>> Some of the newer plotting commands may not produce graphics correctly in=
> =
>>  this
>> mode, but all of the basic functionality will probably work fine.
>>
>> Sincerely,
>>
>> John Fultz
>> jfu... at wolfram.com
>> User Interface Group
>> Wolfram Research, Inc.
>>
>>
>>
>>> Thanks
>>> Yours faithfully,
>>> Lawrence
>>> On Oct 22, 2:25 pm, John Fultz <jfu... at wolfram.com> wrote:
>>>> The basic problem is that the Windows and Enhanced metafile formats
>>>> just =
>>> don't
>>>> have enough features to support a high fidelity vector representation
>>>> of =
>>> certain
>>>> Mathematica outputs...for example, those containing color gradients or
>>>> transparency.  We elected to rasterize the graphics in these cases f=
> igu=
>>> ring that
>>>> a high quality bitmap is better than a low quality vector image.  It=
>  is=
>>> an
>>>> imperfect solution for an imperfect world.
>>>> I would suggest trying to export it as a bitmap with a high enough
>>>> resolu=
>>> tion
>>>> for your needs.
>>>> Sincerely,
>>>> John Fultz
>>>> jfu... at wolfram.com
>>>> User Interface Group
>>>> Wolfram Research, Inc.
>>>> On Wed, 21 Oct 2009 06:32:38 -0400 (EDT), Lawrence Teo wrote:
>>>>> Hi all,
>>>>> I recently found that Mathematica 7 doesn't copy/paste metafile in
>>>>> vector format anymore, as compared to Mathematica 5.2
>>>>> Although I could still Copy As > Metafile in Mathematica 7, pasting i=
> t
>>>>> into Office 2007 will result in rasterized bitmap image. Rasterized
>>>>> bitmap image means low resolution and bad quality. Unacceptable to me=
> .
>>>>> It doesn't help even if I Export to EMF or WMF format. Inserting thos=
> e
>>>>> EMF/WMF files into Office 2007 still gives me the same rasterized
>>>>> bitmap image.
>>>>> I also realize that Mathematica could Copy As > Metafile in vector
>>>>> format successfully for certain functions, but not for all functions.
>>>>> For example, Plot2D[] seems to work. Plot3D[] and ContourPlot[] don't=
> ,
>>>>> no matter how I try.
>>>>> There is very little information online on this topic. I basically
>>>>> just found 2 other similar cases. Does anyone have any solution and
>>>>> workaround to this?
>>>>> Thanks.
> 
> 


  • Prev by Date: Re: How to find the kinks in a list
  • Next by Date: Re: Working with Lists
  • Previous by thread: Re: Mathematica7 doesn't copy/paste metafile in vector format
  • Next by thread: JLink broken on Snow Leopard