Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7626891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:23:12+00:00 2026-05-31T05:23:12+00:00

My data file has four columns because opencv saves elements in an n x

  • 0

My data file has four columns because opencv saves elements in an n x 4 form in xml when exporting a cv::Mat to xml.

How can I concatenate these four columns into one?

reset

set terminal postscript eps enhanced
set output 'imp.eps'
set pm3d
set palette model HSV defined ( 0 0 1 1, 1 1 1 1 )
set style data histogram
set colorbox user
set origin 0.0,0.10
set size ratio 0 1,0.8
set colorbox horizontal origin graph 0.0, -0.15, 0 size graph 1, 0.05, 0 noborder 

set xrange [0:4096]
plot 'var_imp_first_run.data' using 1

set output

I have 4094 elements, and this example creates an histogram where the first 1024 is plotted. I need to append column 2 from x=1024:2048. Please ignore the colorbox stuff; I’m just playing around to learn gnuplot.

I found out that following solve my problem above.

set xrange  [0:4096]
plot newhistogram at 0, 'var_imp_first_run.data' every:: 7 using 1,\
  newhistogram at 1024,'var_imp_first_run.data' every:: 7 using 2,\
   newhistogram at 2048,'var_imp_first_run.data' every:: 7 using 3,\
      newhistogram at 3072,'var_imp_first_run.data' every:: 7 using 4;

Then I found out that it was not what I wanted, because the data are arranged as entries,

x1,x2,x3,x4
x5,x6,x7,x8
and so on.

So what I really need is a histogram that plots the rows before columns. Is it possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:23:13+00:00Added an answer on May 31, 2026 at 5:23 am

    If you want it to read

    x1
    x2
    x3
    

    instead of

    x1,x2,x3
    

    Then (assuming you are on *nix) use

    plot 'cat var_imp_first_run.data | tr "," "\n" |' using 1
    

    This is calling the following command and reading the output via the pipe at the end:

    cat var_imp_first_run.data | tr "," "\n"
    

    Here, tr is just transcribing commas as newlines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading in data from a file that has three columns. For example
I have a very large XML file which has like 40000 data, and when
I am reading data from a file that has, unfortunately, two types of character
I am trying to parse a data file in ANTLR - it has optional
I have data of program usage in excel file, the data has date and
I have a CSV data file with rows that may have lots of columns
I have an xml data file and I want to populate a listview in
I am currently working on a XML-based CMS that saves data in chunks called
My app uses XML to save user data to a file. I have just
I have an excel file with four text columns: one of them is called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.