Menu

Problem with pm3d

Help
ManuGutiTo
2015-12-17
2015-12-18
  • ManuGutiTo

    ManuGutiTo - 2015-12-17

    Hello everybody

    I have a problem with pm3d that's been bugging me for days. I couldn't find an answer anywhere, so it's time to ask!

    I used to have a file of the type
    x y z(x,y)
    that I wanted to plot in contour mode (color fill). I get the error "Single isoline (scan) is not enough for a pm3d plot. Hint: Missing blank lines in the data file? See 'help pm3d' and FAQ.". I saw somewhere that this can be solved by having a blank line whenever the x value changes, so all the x values that are the same are now grouped with a blank line in between different values. I still get the same error, so I'm out of options. (I am certainly not very skilled with gnuplot).

    You can find the file @ https://www.dropbox.com/s/sqpcpdelp2otfjn/test_forum.dat?dl=0 , but it's veeeery long (it's from a numerical calculation I'm doing). I just post it in case you want to check the format.

    Thanks in advance, guys!

     
  • Ethan Merritt

    Ethan Merritt - 2015-12-17

    I do not recognize the description "contour mode (color fill)".
    Please show the commands you are trying to use in making a plot.

    Do you want contours?
    Color fill?
    pm3d surface?

    The commands
    set contour base
    splot 'test_forum.dat' with pm3d

    will get you something, but I don't know if it resembles what you are aiming for.

     
  • ManuGutiTo

    ManuGutiTo - 2015-12-18

    Yeah, that's kind of what I want! (at least now I can see different colours for different heights)

    What I want is this

    https://www.dropbox.com/s/7obkar2k2c8r82w/pot.png?dl=0

    so that I don't get an image with 3D perspective, I want colour to be the only information about height (electrostatic potential in this case, but nevermind). More or less what I get with your commands but seen from above. (What is the name for that? English is not my first language, but I'd say that's a colour fill).

    Thank you very much!

    By the way, the picture was taken from the bachelor's thesis from an old workmate (I feel like I should say this). He used Origin Pro for it, which I don't want to use unless I have to (the PI from my group forces us to use it for publications and the like and I really hate it).

     
  • Ethan Merritt

    Ethan Merritt - 2015-12-18

    OK.
    Add a few commands:

    set contour base
    set pm3d depthorder
    set view map
    splot 'test_forum.dat' with pm3d

    To emphasize the contours:

    splot 'test_forum.dat' with pm3d linewidth 5

    To contour more finely

    set cntrparam levels 50

     

    Last edit: Ethan Merritt 2015-12-18
  • ManuGutiTo

    ManuGutiTo - 2015-12-18

    That was really helpful! Thanks!
    One last thing: what if I want to hide the lines, showing only colours, and plot other lines on top? (The electrodes's shape, e.g., the first one would have three lines:
    x=200, from z=1000 to z=2000
    x= 540, from z=1000 to z=2000
    z=1000, from x=200 to x=540 )

     
  • Ethan Merritt

    Ethan Merritt - 2015-12-18

    If by "hide the lines" you mean don't show contours

    unset contours

    "plot other lines" - lots of ways to do this, please see gnuplot documentation. One way would be "set arrow"

     
  • ManuGutiTo

    ManuGutiTo - 2015-12-18

    unset contours works for me. Thanks again!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.