Message Boards Message Boards

Plot Molar Mass (from book example)?

Anonymous User
Anonymous User
Posted 6 years ago

Consider the following code:

ListLogPlot[
         Transpose[{Table[i, {i, 0, 800, 10}], 
           BinCounts[
            Cases[QuantityMagnitude[ChemicalData[#, "MolarMass"]] & /@ 
              ChemicalData[], _Real], {-5, 805, 10}]}], Filling -> Axis, 
         Frame -> True, Axes -> None, PlotRange -> All, 
         FrameLabel -> {"molar mass", None}]

The above first downloads data SEVERAL TIMES (I have a feeling this is some kind of bug with a solution that WR insiders know how to fix but didn't pass on that burns data/time on unsuspecting users).

Then, it just hangs (cell is highlighted for processing but after 1/2 minute I abort the evaluation. Plotting a datem for a list of elements occurs nearly instantaneously in Mathematica 4.0 on a 686 amd cpu: so I'm sure it doesn't take 1/2 minute on an i3 running on mac mini!)

I've seen some question in channels before about "repetitive downloading of data". (in this case some of the data WR admitted it didn't own - according to one poster, it was from a free source but is only available as "paid up data"? this may be another issue - but i'm not asking at the moment). I'm unsure how i'd find the old post (which search terms), since all the terms are "generic" and the function nameless as far as i know.

But repetative downloading doesn't seem to be the problem (rather - i don't continually see the message after first several times).

I have perfectly no idea if i'm "logged in to get data" but I did pay.

data = Table[{ChemicalData[chem, "BoilingPoint"], 
    ChemicalData[chem, "VaporizationHeat"]}, {chem, 
    ChemicalData["Liquid"]}];

ListPlot[data, AxesLabel -> {"boiling point", "heat of vaporization"}]

The above also has the "repeated re-initializes data" issue and takes at least a minute to run. It's just a list plot. Something has to be broken. On the other hand

ChemicalData["Digitonin", "MoleculePlot"]

displays almost immediately (which obviously requires more processing time - again indicating there is something strange going on).

POSTED BY: Anonymous User

Hi,

I guess the reason is just that there are too many compounds to be loaded with

ChemicalData["Liquid"]

You may want to work with a subset first. For example, the first 10 items give you a plot as follow:

10comp

Every time you query new compound info, Mathematica stores it under "paclet" folder of $UserBaseDirectory.

data

Maybe you do not want to load too much data points at a one time. This will cause large files to be downloaded.

POSTED BY: Shenghui Yang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract