1989

replot command uses latest stats information

Question:

I have two data files, file1.dat and file2.dat. I use following commands to draw two functions.

stats 'file1.dat' u 4:7 plot 'file1.dat' u 4:($7-STATS_min_y) stats 'file2.dat' u 4:7 replot 'file2.dat' u 4:($7-STATS_min_y)

Problem is that the replot command uses the min_y of file2 and applies to file1.dat once again. How can I handle this? Many thanks.

Answer1:

The replot command repeats the previous plot command and adds a new plot. If one variable (STATS_min_y) is used in both commands, the same value is used. You can use e.g. the name parameter for the stats command to save the values in different variables:

stats 'file1.dat' u 4:7 name 'F1_' plot 'file1.dat' u 4:($7 - F1_min_y) stats 'file2.dat' u 4:7 name 'F2_' replot 'file2.dat' u 4:($7 - F2_min_y)

In that case you could of course also use a single plot command:

stats 'file1.dat' u 4:7 name 'F1_' stats 'file2.dat' u 4:7 name 'F2_' plot 'file1.dat' u 4:($7 - F1_min_y), 'file2.dat' u 4:($7 - F2_min_y)

Recommend

  • Using polyfit to predict where the object falls?
  • precision of comparing double values with EPSILON in C
  • LibGDX GwtApplication Exception (TypeError) in HTML Deployment
  • how to save ouput of perf (Linux tool) to a file?
  • Fastest ways to get a directory Size and Size on disk
  • F# signature file error
  • Matplotlib: Custom colormap with three colors [duplicate]
  • F# NativePtr.stackalloc Unexpected Stack Overflow
  • Ansible sudo hangs after 5 tasks
  • How to deal with SpiderWebPlot in JFreeChart?
  • Geom_jitter colour based on values
  • How to create a 2D image by rotating 1D vector of numbers around its center element?
  • Yii2: Finding file and getting path in a directory tree
  • How to create CGPath from a SKSpriteNode in SWIFT
  • List images(01.png) and descriptions(01.txt) from directory
  • Set matplotlib plot axis to be the dataframe column name
  • How integrated is Collada to OpenGL ES
  • Visual Studio 2010 debugger build correctly - compiler pdb and linker pdb not in synch?
  • How to render a blob on a canvas element?
  • Abort upload large uploads after reading headers
  • How to delay loading a property with linq to sql external mapping?
  • Ajax Loaded meta Tags
  • Nant, Vault & Windows Integrated Authentication
  • How do I fake an specific browser client when using Java's Net library?
  • HTML download movie download link
  • swift auto completion not working in Xcode6-Beta
  • Does CUDA 5 support STL or THRUST inside the device code?
  • htaccess rewriting URLs with multiple forward slashes
  • How to model a transition system with SPIN
  • Statically linking a C++ library to a C# process using CLI or any other way
  • ORA-29908: missing primary invocation for ancillary operator
  • Why winpcap requires both .lib and .dll to run?
  • Apache 2.4 - remove | delete | uninstall
  • SVN: Merging two branches together
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • How do I rollback to a specific git commit
  • Is there a mandatory requirement to switch app.yaml?
  • Busy indicator not showing up in wpf window [duplicate]
  • Converting MP3 duration time