seaborn的地块大小相同?

时间:2016-01-21 17:59:08

标签: python matplotlib size seaborn

seaborn有一个名为 JFrame frame = new JFrame(); frame.setResizable(false); frame.setBounds(100, 100, 771, 453); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); JPanel panel = new JPanel(); panel.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); panel.setBounds(10, 32, 747, 370); frame.getContentPane().add(panel); panel.setLayout(null); JPanel VPanel = new JPanel(); VPanel.setBounds(297, 43, 440, 224); panel.add(VPanel); JTable TableV = new JTable(); TableV.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); TableV.getTableHeader().setReorderingAllowed(false); DefaultTableModel Model = new DefaultTableModel(0, 0); String header[] = new String[] { "Country", "ID", "WAN IP", "User", "OS", "Java version" }; VPanel.add(new JScrollPane(TableV, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)); // just adding some data to fill the table Model.setColumnIdentifiers(header); //set model into the table object TableV.setModel(Model); //just adding some diff data to check if it scrolls down for (int count = 1; count <= 50; count++) { Model.addRow(new Object[] { "data1", "data2", "data3", "data4", "data5", "data6" }); } for (int count = 1; count <= 70; count++) { Model.addRow(new Object[] { "data100", "data200", "data300", "data400", "data500", "data600" }); } frame.setVisible(true); 的常用关键字,旨在使图表具有一定的大小。但是,根据xy-ticks和轴标签,图的大小明显不同。无论刻度和轴标签如何,生成具有完全相同尺寸的图的最佳方法是什么?

1 个答案:

答案 0 :(得分:0)

Seaborn大小选项因绘图类型而异,这可能有点令人困惑,因此这是一种有用的通用方法。

首先运行:import matplotlib as plt

然后在每个图的笔记本单元格中添加行plt.figure(figsize=(9, 9))。您可以根据需要调整整数值。