newLISP drawing with Gnuplot

Source: Internet
Author: User

Gnuplot is a good mathematical drawing tool that can be used in Eamcs org mode, and 1 now finds newLISP has long been supported.

Let's start with an example and look at the diagram:



This figure has three polylines, each of which can represent data in three lists. Refer to the following newLISP code:

#!/usr/bin/newlisp;;( Module "PLOT.LSP") (Load "B.LSP") (Set ' Plot:title "Cluster storage Summary") (Set ' Plot:sub-title "Show storage and task volume by Month") (Set ' Plot:labels ' ("2015 /01 "" "" "" "" "" "" "" "" "" "" "" "" "" "", "" "" "" "" "" "" "" "(" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "  Display plot image (plot ' (6209.72 6425.52 7668.77 8146.90 9095.75 11572.1 12739.3)      ' (12714.35 12708.40 12802.94 12802. 94 12802.94 17667.49 17667.49)      ' (7878 11605 7028 7613 9721 11977 12377)      ); Save 11572.1 the displayed image to a File (plot:export "Example-plot.png") (exit)

Description

1. Module PLOT.LSP is canceled because the font set in the code does not support Chinese, so after copying the PLOT.LSP code, the code that sets the font is commented, and the file name is B.LSP.

2. Labels the corresponding list represents the x-axis value

3. Legend represents the legend, noting that the number is equal to the number of polylines

4. Export will automatically save the picture to the file

5. Plot's polyline data requires only the Y value, and the X value is the value of the corresponding position in the labels.






Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

newLISP drawing with Gnuplot

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.