I don't think there is a way to do it inside codeblocks.
Newer gdbs have python scripting support, so probably you can do it inside a python pretty printer or you could define a plot command in python.
I think, you could write the values to a file and then use gnuplot to generate the image.
Then in c::b you can send this command "python my_plot myvar" to gdb.