How to represent a 2D plot in 3D

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to represent a 2D plot in 3D

Gnuplot - User mailing list
Dear Gnuplot User,
I have a set of data PDOS (precisely partial density of state) which shows the contribution of each valence electron to the total density of state of a material.
I will like to plot PDOS in 3D but I really do not know how to go about after sorting for solution on the Internet.
The nature of the PDOS data is given below:# E (eV)   ldos(E)   pdos(E)  
  6.437 -0.747E-05 -0.747E-05
  6.537 -0.173E-03 -0.173E-03
  6.637 -0.653E-03 -0.653E-03
  6.737  0.372E-02  0.372E-02
  6.837  0.120E-01  0.120E-01
  6.937  0.469E-02  0.469E-02
  7.037 -0.579E-02 -0.579E-02
  7.137  0.104E-01  0.104E-01
  7.237  0.952E-01  0.952E-01
  7.337  0.806E-01  0.806E-01
  7.437  0.877E-03  0.877E-03
  7.537 -0.308E-02 -0.308E-02
  7.637  0.328E-01  0.328E-01
  7.737  0.371E-01  0.371E-01
  7.837 -0.422E-02 -0.422E-02
  7.937  0.360E-01  0.360E-01
  8.037  0.151E+00  0.151E+00
  8.137  0.764E-01  0.764E-01
  8.237  0.172E-01  0.172E-01
  8.337  0.623E-01  0.623E-01
  8.437  0.240E-01  0.240E-01
  8.537 -0.774E-02 -0.774E-02

I have a mini script that provides the frame of the 3D plot. I just need to insert the 2D data in the 3D frame.
I just need to use columns 1 and 3 for the plot i.e column 3 for the z-axis and column 1 for x/y axis in 3D.Thank you for your assistance.

Jolayemi Omamuyovwi RitaPhysics Department
University of Benin
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to represent a 2D plot in 3D

Gnuplot - User mailing list
On Saturday, 22 July 2017 05:23:54 Omamuyovwi Akemu via gnuplot-info wrote:

> Dear Gnuplot User,
> I have a set of data PDOS (precisely partial density of state) which shows the contribution of each valence electron to the total density of state of a material.
> I will like to plot PDOS in 3D but I really do not know how to go about after sorting for solution on the Internet.
> The nature of the PDOS data is given below:# E (eV)   ldos(E)   pdos(E)  
>   6.437 -0.747E-05 -0.747E-05
>   6.537 -0.173E-03 -0.173E-03
>   6.637 -0.653E-03 -0.653E-03
>   6.737  0.372E-02  0.372E-02
>   6.837  0.120E-01  0.120E-01
>   6.937  0.469E-02  0.469E-02
>   7.037 -0.579E-02 -0.579E-02
>   7.137  0.104E-01  0.104E-01
>   7.237  0.952E-01  0.952E-01
>   7.337  0.806E-01  0.806E-01
>   7.437  0.877E-03  0.877E-03
>   7.537 -0.308E-02 -0.308E-02
>   7.637  0.328E-01  0.328E-01
>   7.737  0.371E-01  0.371E-01
>   7.837 -0.422E-02 -0.422E-02
>   7.937  0.360E-01  0.360E-01
>   8.037  0.151E+00  0.151E+00
>   8.137  0.764E-01  0.764E-01
>   8.237  0.172E-01  0.172E-01
>   8.337  0.623E-01  0.623E-01
>   8.437  0.240E-01  0.240E-01
>   8.537 -0.774E-02 -0.774E-02
>
> I have a mini script that provides the frame of the 3D plot. I just need to insert the 2D data in the 3D frame.
> I just need to use columns 1 and 3 for the plot i.e column 3 for the z-axis and column 1 for x/y axis in 3D.Thank you for your assistance.
>
> Jolayemi Omamuyovwi RitaPhysics Department

We could understand the question better if you would point
to an example of the type of plot you are trying to create.

You say column 1 for x/y and column 3 for z, so perhaps you want

   splot 'data' using 1:1:3 with lines

        Ethan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to represent a 2D plot in 3D

Gnuplot - User mailing list
In reply to this post by Gnuplot - User mailing list
Many thanks to your response SIr.
I've been able to understand how to use the command better to suit my desired plot but I still have two questions.Using the script and data below, I got something meaningful but I do not understand why I had to first duplicate the set of value before the plot appear.Any comment to help me understand will be greatly appreciated. Secondly, is there a way to indicate a constant plot value for a column without necessarily indicate it in file? (Using my data as example, i had type the the constant value 3 in the second column of the data.)
#script
set terminal postscript eps enhanced color
set encoding iso_8859_1
set output 'omam.eps'
set ticslevel 0
set xlabel 'x'
set ylabel 'y'
set zlabel 'z'


colors = "red red red red red"
splot for [i=1:words(colors)] 'omam.dat' index i u 2:1:3 w lines lc rgb word(colors,i)


#file data 6.437  3  -0.747E-05
  6.537  3  -0.173E-03
  6.637  3  -0.653E-03
  6.737  3   0.372E-02
  6.837  3   0.120E-01
  6.937  3   0.469E-02
  7.037  3  -0.579E-02
  7.137  3   0.104E-01
  7.237  3   0.952E-01
  7.337  3   0.806E-01
  7.437  3   0.877E-03
  7.537  3  -0.308E-02
  7.637  3   0.328E-01
  7.737  3   0.371E-01
  7.837  3  -0.422E-02
  7.937  3   0.360E-01
  8.037  3   0.151E+00
  8.137  3   0.764E-01
  8.237  3   0.172E-01
  8.337  3   0.623E-01
  8.437  3   0.240E-01
  8.537  3  -0.774E-02
  8.637  3   0.584E-01
  8.737  3   0.118E+00
  8.837  3   0.287E-01
  8.937  3   0.760E-02
  9.037  3   0.152E+00
  9.137  3   0.242E+00
  9.237  3   0.791E-01
  9.337  3   0.621E-01
  9.437  3   0.944E-01
  9.537  3   0.641E-01
  9.637  3   0.103E+00
  9.737  3   0.807E-01
  9.837  3   0.622E-01
  9.937  3   0.163E+00
 10.037  3   0.106E+00
 10.137  3   0.117E-01
 10.237  3   0.449E-01
 10.337  3   0.445E-01
 10.437  3   0.289E-01
 10.537  3   0.438E-01
 10.637  3   0.189E-01
 10.737  3   0.759E-03
 10.837  3   0.225E-02
 10.937  3   0.135E-02
 11.037  3   0.159E-02
 11.137  3   0.125E-02
 11.237  3   0.730E-04

Thank you in advance for the anticipated comments.


Jolayemi Omamuyovwi RitaUniversity of BeninNigeria
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to represent a 2D plot in 3D

Ethan A Merritt-2
On Saturday, 22 July 2017 21:10:19 Omamuyovwi Akemu via gnuplot-info wrote:
> Many thanks to your response SIr.
> I've been able to understand how to use the command better to suit my desired plot but I still have two questions.Using the script and data below, I got something meaningful but I do not understand why I had to first duplicate the set of value before the plot appear.

I do not understand what you are saying.

> Any comment to help me understand will be greatly appreciated. Secondly, is there a way to indicate a constant plot value for a column without necessarily indicate it in file? (Using my data as example, i had type the the constant value 3 in the second column of the data.)

Anything in parenthesis is evaluated as an expression.
That expression can be a simple constant.

    splot  ...  using (3.0):1:3 with lines

If you want each indexed block to have a different x coordinate:

   splot for [i=1:n] 'omom.dat' index i using (i):1:3 w lines lc rgb word(colors,i)



> #script
> set terminal postscript eps enhanced color
> set encoding iso_8859_1
> set output 'omam.eps'
> set ticslevel 0
> set xlabel 'x'
> set ylabel 'y'
> set zlabel 'z'
>
>
> colors = "red red red red red"
> splot for [i=1:words(colors)] 'omam.dat' index i u 2:1:3 w lines lc rgb word(colors,i)
>
>
> #file data 6.437  3  -0.747E-05
>   6.537  3  -0.173E-03
>   6.637  3  -0.653E-03
>   6.737  3   0.372E-02
>   6.837  3   0.120E-01
>   6.937  3   0.469E-02
>   7.037  3  -0.579E-02
>   7.137  3   0.104E-01
>   7.237  3   0.952E-01
>   7.337  3   0.806E-01
>   7.437  3   0.877E-03
>   7.537  3  -0.308E-02
>   7.637  3   0.328E-01
>   7.737  3   0.371E-01
>   7.837  3  -0.422E-02
>   7.937  3   0.360E-01
>   8.037  3   0.151E+00
>   8.137  3   0.764E-01
>   8.237  3   0.172E-01
>   8.337  3   0.623E-01
>   8.437  3   0.240E-01
>   8.537  3  -0.774E-02
>   8.637  3   0.584E-01
>   8.737  3   0.118E+00
>   8.837  3   0.287E-01
>   8.937  3   0.760E-02
>   9.037  3   0.152E+00
>   9.137  3   0.242E+00
>   9.237  3   0.791E-01
>   9.337  3   0.621E-01
>   9.437  3   0.944E-01
>   9.537  3   0.641E-01
>   9.637  3   0.103E+00
>   9.737  3   0.807E-01
>   9.837  3   0.622E-01
>   9.937  3   0.163E+00
>  10.037  3   0.106E+00
>  10.137  3   0.117E-01
>  10.237  3   0.449E-01
>  10.337  3   0.445E-01
>  10.437  3   0.289E-01
>  10.537  3   0.438E-01
>  10.637  3   0.189E-01
>  10.737  3   0.759E-03
>  10.837  3   0.225E-02
>  10.937  3   0.135E-02
>  11.037  3   0.159E-02
>  11.137  3   0.125E-02
>  11.237  3   0.730E-04
>
> Thank you in advance for the anticipated comments.
>
>
> Jolayemi Omamuyovwi RitaUniversity of BeninNigeria
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> gnuplot-info mailing list
> [hidden email]
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>

--


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to represent a 2D plot in 3D

Gnuplot - User mailing list
In reply to this post by Gnuplot - User mailing list
Many many thanks Sir Ethan A Merritt.
I sincerely appreciate your prompt response. I now have the solution to my questions. Thank you Sir.However, I will appreciate any clue that can help me add colours to the several planes (x-y plane, x-z plane and x-y plane).
I tried the command:
set palette model RGB functions 0.9, 0.9,0.95

it did not yield good result.


Secondly, I also desire to fill the area below the line in the 3D plot but don't know.

Thanks a million.


Jolayemi Omamuyovwi Rita
University of Benin
Nigeria
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to represent a 2D plot in 3D

Ethan A Merritt-2
On Saturday, 22 July 2017 23:20:19 Omamuyovwi Akemu via gnuplot-info wrote:
> Many many thanks Sir Ethan A Merritt.
> I sincerely appreciate your prompt response. I now have the solution to my questions. Thank you Sir.However, I will appreciate any clue that can help me add colours to the several planes (x-y plane, x-z plane and x-y plane>

There is no easy way to do that in gnuplot.

> Secondly, I also desire to fill the area below the line in the 3D plot but don't know.

It depends which gnuplot version you are using.
This demo shows two different methods

  http://gnuplot.sourceforge.net/demo_5.2/fenceplot.html

The first method (top plot) can be used with older gnuplot versions.

The second method (bottom plot) is much easier but it requires version 5.2
which at the moment is only available as a release candidate.
Here is another demo using the new method:

   http://gnuplot.sourceforge.net/demo_cvs/zerror.html


        Ethan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Loading...