Py6S icon indicating copy to clipboard operation
Py6S copied to clipboard

Added matplotlib requirement

Open nidhin976 opened this issue 2 years ago • 3 comments

Calling SixSHelpers.Angles.run_and_plot_360 getting error "name 'subplots' is not defined"

nidhin976 avatar Sep 16 '21 05:09 nidhin976

Codecov Report

Merging #90 (d90b2b7) into master (ee2abb4) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #90   +/-   ##
=======================================
  Coverage   88.00%   88.00%           
=======================================
  Files          18       18           
  Lines        1717     1718    +1     
=======================================
+ Hits         1511     1512    +1     
  Misses        206      206           
Impacted Files Coverage Δ
Py6S/SixSHelpers/all_angles.py 38.46% <100.00%> (+0.53%) :arrow_up:

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 ee2abb4...d90b2b7. Read the comment docs.

codecov[bot] avatar Sep 16 '21 13:09 codecov[bot]

Thanks for the PR.

It's weird that this is happening for you, as there is specific code in the plot360 method (called by run_and_plot_360) which tries to import from matplotlib, and then gives an error if it can't. The import is deliberately inside this function, so that Py6S is useable without matplotlib installed.

On line 108 of all_angles.py there is this code:

try:
      from matplotlib.pyplot import plot, show, subplots, xlabel, ylabel
except ImportError:
      raise ImportError("You must install matplotlib to use the plotting functionality")

Can you check if that code is there in your version? It should solve this problem...

robintw avatar Sep 16 '21 13:09 robintw

Yes, I have checked the code appears the same.

nidhin976 avatar Sep 17 '21 04:09 nidhin976