Python third-party library (OPENPYXL)Ground weather Map
The data that is scheduled in a column or row on a worksheet can be drawn in a table. A surface chart is useful when you want to find the best combination between two sets of data. As in topographic maps, the areas represented by colors and patterns are the same ranges. By default, all surface plots are 3D. Create 2D wireframe and contour plots by setting rotation and perspective.
fromOpenpyxlImportWorkbook fromOpenpyxl.chartImport(Surfacechart, Surfacechart3d, Reference, Series,) fromOpenpyxl.chart.axisImportSERIESAXISWB=Workbook () WS=Wb.activedata=[None,10, 20, 30, 40, 50,], [0.1, 15, 65, 105, 65, 15,], [0.2, 35, 105, 170, 105, 35,], [0.3, 55, 135, 215, 135, 55,], [0.4, 75, 155, 240, 155, 75,], [0.5, 80, 190, 245, 190, 80,], [0.6, 75, 155, 240, 155, 75,], [0.7, 55, 135, 215, 135, 55,], [0.8, 35, 105, 170, 105, 35,], [0.9, 15, 65, 105, 65, 15],] forRowinchdata:ws.append (Row) C1=Surfacechart () ref= Reference (WS, min_col=2, Max_col=6, Min_row=1, max_row=10) Labels= Reference (WS, Min_col=1, min_row=2, max_row=10) C1.add_data (ref, Titles_from_data=True) c1.set_categories (labels) c1.title="Contour"Ws.add_chart (C1,"A12") fromCopyImportdeepcopy#wireframeC2 =deepcopy (C1) C2.wireframe=Truec2.title="2D Wireframe"Ws.add_chart (C2,"G12")#3D SurfaceC3 =Surfacechart3d () c3.add_data (ref, Titles_from_data=True) c3.set_categories (labels) c3.title="Surface"Ws.add_chart (C3,"A29") C4=Deepcopy (C3) C4.wireframe=Truec4.title="3D Wireframe"Ws.add_chart (C4,"G29") Wb.save ("surface.xlsx")
View Code
Python third-party library OPENPYXL (12)