Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Improve Triangular axes projection #295

Merged
merged 14 commits into from Jan 18, 2021
Merged

FIX: Improve Triangular axes projection #295

merged 14 commits into from Jan 18, 2021

Conversation

bocklund
Copy link
Collaborator

This PR houses a few changes, all in the TriangluarAxes projection class.

  1. simplification of the transformations code
  2. stop calling classmethods of Axes and passing self
  3. fix several methods, such as get_xaxis_text1_transform, to call the superclass and get the transform after padding. This means setting the padding of the ticks and axis labels now works correctly for both axes.
  4. add an override to set_ylabel that sets a default rotation of 60 degrees

@codecov
Copy link

codecov bot commented Dec 29, 2020

Codecov Report

Merging #295 (caeabb9) into develop (d217b4b) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #295      +/-   ##
===========================================
- Coverage    86.77%   86.77%   -0.01%     
===========================================
  Files           46       46              
  Lines         4461     4460       -1     
===========================================
- Hits          3871     3870       -1     
  Misses         590      590              
Impacted Files Coverage Δ
pycalphad/plot/eqplot.py 69.56% <ø> (-0.33%) ⬇️
pycalphad/plot/triangular.py 94.80% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d217b4b...caeabb9. Read the comment docs.

@bocklund
Copy link
Collaborator Author

There's still some outstanding "like to have" items, but I don't think I'll address them in this PR, mainly:

  • Tune the padding/position of the ylabel better automatically. Currently the position is at (0, 0.5) of the untransformed axes coordinates, but it would probably make sense for the position to be transformed. I think it should be transformed using the transforms already defined (like the ticks), but for some reason it is not.
  • Tune the number of ticks/labels. Currently the ticks are hardcoded to be in [0, 1] in 0.1 increments. Without this hardcoded, there are two issues. First, the x- and y-axes may have different divisions, which looks awkward. Second, the divisions tend to only go down to increments of 0.2 at reasonable label sizes. This is caused by how the automatic tick numbering in matplotlib works. Two other classes would need to be overriden: first the XAxis/YAxis classes to modify how get_tick_space computes how many tick spaces are available (some tuning would need to be done to balance the number of ticks and the spacing of the labels), and second the MaxNLocator class would need to be overridden to increase the number of ticks that can form in automatic mode from 9 to >=10 (to allow increments of 0.1).

@bocklund bocklund added this to the 0.8.5 milestone Jan 7, 2021
@bocklund bocklund merged commit be40446 into develop Jan 18, 2021
@bocklund bocklund deleted the triangular-fixes branch January 18, 2021 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants