Add option for 2nd x-axis in different units
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Currently Curvallis has no notion of "units." The X and Y values are just numbers. However, if an EOS person (ie, Christine) is using Cuvallis, the X axis is nearly always in either denisty (g/cc) or Volume (cc/g or Angstrom^3/atom).
Density and volume are closely related, the CGS units for density is g/cc and for volume is cc/g. (It's just a reciprocal. It's slightly more complex if she wants volume to just be "cc" because you need to remove the grams)
Christine would like to be able to have 2 X-axes in different units. Maybe have volume at the bottom and density at the top. Like this example: https://matplotlib.org/3.1.0/gallery/subplots_axes_and_figures/secondary_axis.html
This poses some problems aside from the display issue:
1. How do we declare we want this mode?
2. How do we declare the "main" units? (This will determine the direction of the graph)
3. How do we declare the sub units?
4. How do we convert the sub units?
5. If the volume is in cc/g, it's easy, it's just a reciprocal. But Christine suggested she might prefer angstrom^3/atom. In which case we need the atomic mass.
(If we wanted to be totally generic I guess we could add a units conversion module.)
But otherwise this is the conversion factor between cc/g and angstrom^3/atom
ATOMIC_VOLUME_TO_CGS = 0.602214179;
AMass = atomic mass
double convertAtomicVolume2CGS(const double AVolume) {
return AVolume * ( ATOMIC_VOLUME_TO_CGS / Amass);
}
double convertCGSVolume2Atomic(const double CGSVolume) {
return CGSVolume * (Amass() / ATOMIC_VOLUME_TO_CGS);
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by reviewing Curvallis's existing axis and plotting configuration alongside the linked Matplotlib secondary-axis example. Done means defining how secondary-axis mode, main and sub-units, and the required density/volume conversions are specified and displayed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100