Home > Software engineering >  How to get a plot out of LuxPy package
How to get a plot out of LuxPy package

Time:06-02

I'd like to plot the color-rendering information for a given spectrum using the lx.cri.plot_cri_graphics(SPD) function of the 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?

CodePudding user response:

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.

  • Related