Some Problems about scientific plotting by GNU Ave ave

Source: Internet
Author: User

As an open-source alternative to Matlab, GNU Ave ave is similar and different. Especially in scientific plotting, it is not a habit to start using it. It cannot be said here. Without commercial support, in the field of professional software, the quality, ease of use and comprehensive functions of open-source software are hard to guarantee: after all, it only provides an open window for advanced users and those who are willing to spend their time on it, so that you can go in and see what you actually need; the user experience is secondary. Compared with Matlab, the scientific drawing effect of GNU Ave ave is too far. However, through some tests and adjustments, I still use Ave ave to get a satisfactory drawing effect, which is sufficient for sending articles and writing reports. The following describes some problems and solutions encountered during use.
The plot command cannot be used on 64-bit Win7
Previously, Windows binary (MinGW32 version) of Ave ave was directly installed on 64-bit Win7, but there was always an error in the figure command plot. Now we can see that the problem is caused by the oct2mat package in Ave ave-forge. Just cancel the installation. If you have installed Ave ave, you can run the following command at the Octave prompt so that oct2mat package is not loaded at startup:

Pkg rebuild-noauto oct2mat
If you want to re-enable oct2mat, run the following command:

Pkg load oct2mat
XP image window frozen and cannot be refreshed
If you run Ave ave on XP, the pop-up figure window cannot be refreshed and the curve cannot be seen at all. After it is forcibly disabled (the gnuplot in the background), no response is returned when you call the plot command. Later, we found that using the refresh command can re-draw the figure window and obtain a response again. The command for clearing and redrawing a figure is as follows:

Clf or clearplot: used to clear the current figure window. The essence of calling clf () is to delete the visible handles in the current figure window. If clf ("reset") is called, all handles are deleted.

Linoleic: clears the current coordinate system.
Drawnow: refresh the window and its sub-objects, clear the event queue, and execute the generated callback function.
Refresh: refresh the figure and repaint it.

The difference between drawnow and refresh is:

Only figures that are modified will be updated. The 'refresh' function can also be used to force an update of the current figure, even if it is not modified.

Therefore, refresh can be used to refresh frozen figure windows, but drawnow does not.

Octave graphics Output Terminal
By default, the plot command of Ave ave outputs the image to the graphic interface, which uses the gnuplot windows terminal or wxt terminal (that is, wxWidget terminal, in the pop-up window, buttons such as rotation and amplification are provided to provide more comprehensive functions ). To output images to files, you can use the print command. If the output is a vector image, select epsc2 in color. If you use a black-and-white eps terminal, no matter how you set the line type and line width are invalid, it seems that the eps terminal itself has a set of line and line width settings.

Font and Plot area size settings in figure
The figure font exported by Ave ave is very small and cannot be identified. This is because the default drawing area size of the figure object is 8.5x11 inch, and the default font size of the axis object is 12pt (the drawing is performed in the axis object of the figure object ). Here, the object attributes can be obtained by the get command, for example:

Get (0); # get screen Properties
H = figure (1 );
Get (h); # get the figure attribute
Plot (...);
Get (gca); # get the axis attribute
Then we can get the papersize and paperunits attributes of figure, and the fontsize attribute of axis.

If the size of the drawing area is not changed, it is more appropriate to enlarge the font to 28pt. Note that if the font is too large and the length of the x or y axis title of figure is too long, the characters displayed exceed the size of the paper. At the same time, because the default font SIZE is changed, when you execute the print command to export images, you also need to use the option-F: SIZE to ensure proper Character spacing, otherwise, the tick label of the coordinate axis overlaps with the title of the x or y axis. Although the file claims that the-F: SIZE Option is used to specify the SIZE of all text in the figure, in fact it only serves to set a default font SIZE for the entire graphic environment, the corresponding Character spacing is controlled by this amount. Test shows that if you only use
-F: If the SIZE option is not specified, the output font is still 12pt by default. In the following example, the command is output to the epsc2 terminal and converted to png format:

Print (h, "output. eps", "-depsc2", "-F: 28 ");
System ("gswin32c-dNOSAFER-r1200-dBATCH-sDEVICE = png16m-dNOPAUSE-dEPSCrop -sOutputFile=output.png output. eps ");
Set marker attributes
Although Octave has the markeredgecolor and markerfacecolor options, but it does not support setting these two options separately, this is due to the limitations of gnuplot itself. When the line type is line & marker, the color attribute also sets the color of the line and marker. If you want the two colors to be different, it is better to solve the problem. Just separate the line and the marker. When you draw a marker separately, set markeredgecolor and markerfacecolor to the same color. In this case, you can also set the linewidth attribute, which is essentially
The width of the marker edge.

Tick label settings
Set the tick location:

Set (gca, "xtick", xtick_values );
Set (gca, "ytick", ytick_values );
Set the tick label string:

Set (gca, "xticklabel", xlabels );
Set (gca, "yticklabel", ylabels );
Xlabels and ylabels are strings of cell array.

 

 

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.