12
$\begingroup$

How can I plot the Hertzsprung–Russell diagram diagram of stars using Mathematica? Pl. help in the plotting command in details including the process to import data on stars if any

$\endgroup$
3
  • 2
    $\begingroup$ Well what do you have so far? This website is for the implementation in Mathematica, so I would assume you'd already have raw data before wondering about how to code this. $\endgroup$
    – Feyre
    Sep 6, 2016 at 8:51
  • 1
    $\begingroup$ In principle, use StarData. But StarData is so slow that I just don't see how to get all the data in a reasonable amount of time. The command would be StarData[EntityClass["Star", All], {"EffectiveTemperature", "AbsoluteMagnitude"}]. $\endgroup$
    – Szabolcs
    Sep 6, 2016 at 8:54
  • 5
    $\begingroup$ Perhaps this would be helpful Evolution of Stars: Hertzsprung-Russell diagram $\endgroup$
    – Sumit
    Sep 6, 2016 at 9:03

2 Answers 2

22
$\begingroup$

The difficult bit is finding the data, as Szabolcs points out. Easier to find them online and import them as a dataset:

starData = 
  SemanticImport[
   "http://astrostatistics.psu.edu/datasets/HIP_star.dat"];
ListPlot[starData[All, {"B-V", "Vmag"}], 
 ScalingFunctions -> {Identity, "Reverse"}, Frame -> True, 
 AspectRatio -> 1, FrameLabel -> {"B-V", "v"}, 
 PlotRange -> {{0, 2}, {15, 2}}]

H-R

$\endgroup$
3
  • $\begingroup$ Yes, but I need a full command, to plot the Luminosity vs Temperature of H-R diagram, including data for main sequence stars number as suitable $\endgroup$
    – S.Islam
    Sep 6, 2016 at 15:30
  • $\begingroup$ Pl. help me plot the HR diagram given in first page of google search: Main sequence - Wikipedia, the free encyclopedia. I need the data along with the plotting command. $\endgroup$
    – S.Islam
    Sep 6, 2016 at 16:22
  • 2
    $\begingroup$ This diagonal across the plot is the main sequence. Now for formatting in the same way as wikipedia I think you need to look at sumit's comment. All in all your question is "how can I plot the H-R diagram of stars and import some data?" and that's exactly what I do here. $\endgroup$
    – gpap
    Sep 6, 2016 at 17:21
9
$\begingroup$

In principle, the data can be retrieved within Mathematica using

StarData[All, {"EffectiveTemperature", "AbsoluteMagnitude"}]

In practice, this command is so slow that it is literally unusable.

Luckily, the older and deprecated AstronomicalData can get you the same data in a couple of minutes.

bv = AstronomicalData["Star", "BVColorIndex"];
magn = AstronomicalData["Star", "AbsoluteMagnitude"];

ListPlot[Transpose[{bv, magn}], 
 ScalingFunctions -> {Identity, "Reverse"}, Frame -> True, 
 Axes -> False, ImageSize -> Large]

@gpap already showed how to format nicely. This answer is only to show how to get the data using builtin data sources.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.