Python third-party library OPENPYXL (12)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.