Issue
I'd like to plot the color-rendering information for a given spectrum using the lx.cri.plot_cri_graphics(SPD)
function of the LuxPy package.
There is the following example code on page 17 of this official tutorial which passes a predefined spectrum (SPD) to the mentioned function.
"The LuxPy.cri subpackage also supports a function that [...] provides TM30-like graphical output. For example, the code below generates the output in Fig. 7"
import luxpy as lx
SPD = lx._CIE_ILLUMINANTS['F4']
data,_,_ = lx.cri.plot_cri_graphics(SPD)
Figure 7:
In my case, the program just finishes without plot, errors or terminal output.
The data
object in the above example contains a bunch of data and is of type dict
, but no plot appears and the script just finishes. Many of the package's classes have dedicated .plot()
member functions, which - for my understanding - should all work the same way. But I do not get any plots popping up for any of those either (like I'm used to from working with Matplotlib).
Is there anything I need to do beside calling the .plot_cri_graphics()
funtions? Something that may be self-explanatory for someone more experienced?
Do I have to pass data
to another plot funtion to actually get a plot output?
Solution
The official tutorial uses IPython with inline plotting (see section 5.1: %matplotlib inline
, see Plotting for details). If you run the example as plain python file, you'll need to add plt.show()
at the end to actually show the plot.
Answered By - Stef
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.