Orange Forum • View topic - Save Graph in Classification Tree View

Save Graph in Classification Tree View

A place to ask questions about methods in Orange and how they are used and other general support.

Save Graph in Classification Tree View

Postby shu » Wed Sep 15, 2010 13:20


I have a problem regarding saving graphs within the "Classification Tree View". I have tried several methods in order to save graphs in better formats instead of "PNG", "BMP", or "GIF".

When saving with SVN, the inkscape couldn't open it properly?? (no texts, too wide layouts...)

When saving with matplotlit, it generates a py file with only layout settings but without data??

When saving with DOT tree file, I got the following errors:
Unhandled exception of type AttributeError occured at 5:11:28:
File:, line 628 in saveDot
Code: orngTree.printDot(self.tree, filename)
File:, line 639 in dotTree
Code: leafShape = leafShape, nodeShape = nodeShape, fle = fle).dotTree()
File:, line 509 in __init__
Code: if tree.classVar.varType == orange.VarTypes.Discrete:
AttributeError: 'orange.TreeNode' has no attribute 'classVar'

I tried both on Linux box and Windows box... same results....
Can anyone suggest me "any" work-around method to at least generate nice graph which I can put into my report??

Thank you very very much for your help...

Postby Ales » Fri Sep 24, 2010 9:45

Can you try saving as SVG again with the latest Orange snapshot.

Postby Guest » Mon Sep 27, 2010 15:16

Hello Ales,

Thanks. With the 0927-build of Orange and saved as SVG:

The layout size is correct now and the rectangles, pies and lines are also correct. But, there is no generated TEXTs? Could that be the font encoding problem?? or I need to install additional fonts on my computer?

I am on Linux box and opened with inkscape.

Thank you.

Postby Ales » Tue Sep 28, 2010 9:56

I tested saving as svg and opening with Inkscape on Kubuntu 10.04 and it worked fine (also works on Mac OSX).
I'am not sure what the problem could be. You have the fonts installed considering Qt was able to display them, maybe Inkscape (GTK backend) just isn't aware of them.

Postby shu » Tue Sep 28, 2010 13:51

Thanks Ales,

The generation of svg file from Orange was correct. The texts are correctly generated in the svg file. The problem was on the font handling of my system.

Somehow, I need to replace all the "Sans Serif" font to "sansserif" in the svg file in order to be loaded into Inkscape. Sorry I didn't check the svg file before sending the previous post. i can now confirm the save svg functionality is fine.

Thank you.

Return to Questions & Support