Question

I am considering if is feasible to use Gnuplot for my needs. And since I have little experience with it, I need to ask to more knowledgeable persons.

I need basically to visualize data coming from different datasets; but it can't be merged on a single plot. Also I need to add text, to display certain values, which I cannot display as legend or on top of the plot, to not cause confusion.

What I would like to do, is to make something similar to what you see in Xcode Instruments: a grid view with stacked graphs, where each graph does not occupy the whole portion of the plot, but just part of it, and then I can put text on the sides of the plot, in specific sections.

Something like this, to give you a visual (not exactly the same of course):

https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/art/Instruments_2x.png

I was checking the examples, and was able to ad a plot with a dot at a specific place; which help me to identify specific values on each plot, using

set object circle

I have found a way to stack the graphs, with

set multi plot layout

But I can't find an easy way to also resize the plot, so I can make room on left and right sides, to put some text in it.

Any suggestion is more than welcome...I don't even know if Gnuplot is in fact the best tool for the job. I will put the plot images on reports and on our intranet.

Was it helpful?

Solution

set multiplot and then changing the margins let you freely modify the position of all your graphs and customize the distance between them. If you want four graphs on top of each other similar to what you showed in the link, you could do something like the following:

set multiplot

set lmargin at screen 0.2 # Sets left margin at 0.2 from left end
set rmargin at screen 0.9 # Sets right margin at 0.9 from left end

set tmargin at screen 0.9 # Sets top margin at 0.9 from bottom
set bmargin at screen 0.7 # Sets bottom margin at 0.2 from bottom

set format x '' # Remove numbers along x axis

plot sin(x)

set tmargin at screen 0.7 # Sets top margin at 0.7 from bottom
set bmargin at screen 0.5 # Sets bottom margin at 0.5 from bottom

plot cos(x)

set tmargin at screen 0.5 # Sets top margin at 0.5 from bottom
set bmargin at screen 0.3 # Sets bottom margin at 0.3 from bottom

plot exp(x)

set tmargin at screen 0.3 # Sets top margin at 0.3 from bottom
set bmargin at screen 0.1 # Sets bottom margin at 0.1 from bottom

set format x # Restore numbers along x axis

plot x**2

enter image description here

And of course you can complicate this as much as you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top