I am using xmgrace to plot several graphs on a shared axed, from a two-column data file like so:
# title "RMSD"
# xaxis label "Time (ns)"
# yaxis label "RMSD (nm)"
#TYPE xy
# subtitle "C-alpha after lsq fit to C-alpha"
1.7125001 0.0005074
1.7225001 0.0635904
1.7325001 0.0747008
1.7425001 0.0707590
1.7525001 0.0821623
1.7625000 0.0842335
1.7725000 0.0929994
1.7825000 0.0938834
1.7925001 0.1014052
1.8025001 0.1107717
1.8125001 0.1106072
1.8225001 0.1032858
1.8325001 0.0967231
1.8425001 0.1072746
So, I call the command to show me all graphs on the GUI
xmgrace 1.xvg rmsd_amber_2.xvg rmsd_3.xvg
Is it possible to automatically use the filenames as the labels for the legend, using an option found within the GUI of xmgrace? So far xmgrace automatically uses different line colors for each data series, but does not show the filename as the data label.
If this is not possible, please suggest me another GUI software for Linux which is able to open xvg files from the terminal for its visualization "on the fly".
Thanks !
Xmgrace does not do what you want
The xmgrace help (shown by calling xmgrace --help at the terminal) shows that there is no command line flag to specify data set legend titles. If that were the case you could probably come up with some bash commands to parse the title from your data files.
But there is another way
As an alternative, you can load a parameters file containing the correct titles. If you save any parameters file from within the xmgrace GUI and load it in a text editor, you will see that almost every aspect of Plot, Graph and Set appearance properties can be controlled.
However, it is not all needed; we can delete almost all of that information and just keep the lines related to our data set legend titles (everything else will just take the default values).
Solution
A minimal parameter file "template.par" might contain just the following four lines:
with g0
s0 legend "title0"
s1 legend "title1"
s2 legend "title2"
where in your case "title1" would be "RMSD".
You can then use xmgrace -param template.par 1.xvg rmsd_amber_2.xvg rmsd_3.xvg to create the plot.
Automating it
So far so good, but you want to create template.par automatically by parsing your chosen bunch of .xvg files. You could probably achieve this in any number of different ways using a bash script or even a bash one-liner.
Related
I have a 13 column xlsx and I want convert to pdf.
I use this code: "soffice" ,"--headless","--convert-to", "pdf" , filepath ,"--outdir",outpath.
I can convert to pdf but the columns too many so they have been showed on four pages.
I need they show on one page.
And it show on straight , I need it show on horizontal.
Thanks
XLSX printout settings (PDF export) are part of the file contents so here is the same file saved with different settings but same export command. (convert-to implies headless, so not generally needed. The author decides a cell content and shape and also sets how many rows and columns will fit in a standard page such as A4 portrait or A4 Landscape etc. Thus only a macro can change print layout area. The best that may be possible externally is to scale it up or down on to bigger or smaller paper.
soffice --convert-to pdf:calc_pdf_Export "DataTables example Default.xlsx"
soffice --convert-to pdf:calc_pdf_Export "DataTables example A3.xlsx"
You need to change layout for printing and export in the preview screen if you want 13 columns you set area from A:1 to M:Y where Y is your desired number of lines (whatever their variable height may be.)
I create png graphs using xmgrace via the bash script working from the terminal w/o gui:
gracebat *.xvg -hdevice PNG -fixed 400 260 -printfile *.png -hardcopy
could you suggest me commands (or alternatively a script for the batch mode) which will customize the output graphs? In particular, I would like to increase the size and the font along the XY axes and customize the legend.
If xmgrace is not a good editor, could you suggest me another command-line utility for linux with better options for the graphs visualization?
Thank you!
In addition to grace batch files, you have a few more (non mutually exclusive) options:
You can use a custom Default.agr (see here for an example) to improve the visual appearance of your plots out-of-the-box
You can use parameter files: create a plot (with legend and all) and use the "Load -> Save parameters..." menu option to save a parameter file. From bash, use the -param switch to use that parameter file with other sets of data (e.g. gracebat *.xvg -param myparams.par -hdevice PNG -fixed 400 260 -printfile *.png -hardcopy).
You can use (or write) a utility program to automatically edit .agr files (which are plain text files). A really nice one is pygrace. With pygrace you can easily write python scripts that generate or edit agr files in a very straightforward way.
i have a code which gives several images as ouput and i want to set all these images in particular axes in GUI in matlab. I'm trying to make a GUI of the code.
For eg.
figure,imshow(s1);
figure,imshow(s2);
figure,imshow(s2&s1);
and i want to set the output image of first command in, say axes3, output image of second command in axes4 and similarly last output image in axes5.
Although i know i need to use
set(handles.axes...)
command but i don't know the exact syntax on how to make the image be shown in particular axes.
Please give explain on how to make this happen with any suitable example. Thanks in advance.
One line solution (for each image) is to set the axis as the parent of the image within the imshow command;
imshow(image_Data,'Parent',handles.axes1)
There should be no need to open the additional figure windows ( assuming the axes are with the gui...)
So specifically for the question above:
imshow(s1,'Parent',handles.axes3);
imshow(s2,'Parent',handles.axes4);
imshow(s2&s1,'Parent',handles.axes5);
First you should create an axes box in your gui, then in tag section get a name i.e. (original) and finaly in editor when you want to use it code something like this
A = imread (Path);
axes(handles.original);
imshow(A);
I hope to help you...
I don’t know whether it is possible? Forgive me if it is silly.
I am using the putty. Where I will run scripts and scripts results large set of set of unorganized data. In which i have to search the data.
For instance in the large set of data retrieved i have to highlight or change the color of the font in the sentence which contains the text "ERROR"?
"the large set of data retrieved i have to highlight or change the color of the font"
hgrep (highlight grep) provides such functionality.
http://acme.com/software/hgrep/
using vi
":set hlsearch" highlight search keyword. but, when data is large, you should have enough memory to load whole data file
I am writing a small CNC G-Code editor. I would like to load the code file into a rich text box (or other?) and color highlight the X,Y,Z,Rand F as it loads.
I've tried loading the file and parsing it afterwords by running through a character at a time to determine what it is and then coloring it but this is impossibly slow. some of my G-Code programs run to thousands of lines.
I know it can be done..... but in VB6??
The richText controls can have RTF data "streamed" into it, or you can append text and set the colours as you go.
If it needs to be done "live" then do it when the cursor's line changes and recolour just the previous line.