'Plotting bar charts in gnuplot with nan values

I would like to plot a bar chart with bars side by side as shown here. The format of my data is the same as shown in the examples. Each column contains the value of the bar for a particular category for the corresponding value on the x-axis. However, in my data set, one column is purposely NaN. This is to show that for this category, the value at all possible values on the x-axis is NaN (it is the result of an unstable method).

However, gnuplot is complaining that " All points in histogram UNDEFINED". I'd like to have a legend in my plot for this category despite all its values being nan to really drive home the point that this category results in unstable results.

Is there any way I can get over this issue? I cannot simply set arbitrary values to replace the NaNs.

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source