can i plot 2 figure using plot.plot

Asked by Diego Sotro

hi guys,
i try to plot 2 figure using plot.plot, but i didn't do it . is this possible???
i don't want use subplots. if this is impossible i use matplotlib and then the question is, are there any analog function to plot.addData.

regards

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi Diego,

you actually already answered yourself :-)

> i don't want use subplots.

then use plot.plot(subPlots=False) # [1]

########################
from yade import plot
plot.data = dict(a=[0,1,2],b=[2,4,8],c=[4,5,6],d=[8,6,5]) # normally
created by plot.addData(...)
plot.plots = {'a':'b', 'c':'d'}
plot.plot(subPlots=False)
########################

if you want two plots with the same horizontal axis, use space in
plot.plots:

########################
plot.plots = {'a':'b', 'a ':'d'} # note the space in the second 'a ', [2]
plot.plot(subPlots=False)
########################

if this is impossible i use matplotlib and then the question is, are there
> any analog function to plot.addData.

it is also possible, e.g. to create some more sophisticated graphs.
plot.data is just plain python dictionary, whose keys are variable names
and values are lists of saved values. So you have all the data and can do
whatever you want with them

cheers
Jan

PS: a MWE [3] is always useful, e.g. to see what you have already tried etc.

[1] https://yade-dem.org/doc/yade.plot.html#yade.plot.plot
[2] https://yade-dem.org/doc/user.html#multiple-figures
[3] https://yade-dem.org/wiki/Howtoask

Revision history for this message
Diego Sotro (horusdnsr) said :
#2

thanks jan,

firstly i believe that my level in YADE is noob, secondly i meant to say that i don't want use ONLY subplots, i'm working with extended granulometry (PSDSize) searching a critical hydraulics gradient when piping begins. my plot data is as follows:

    plot.addData(Vmf=velMeanFino, VMaxf=velMaxFino,Vmg=velMeanGros, VMaxg=velMaxGros, i=__builtin__.time1, i1=__builtin__.time1 , i2=O.iter, ic=__builtin__.icr, ii=it, Gf=Gfp, Gg=Ggp, Tf=tensf, Tg=tensg)

and i want to plot two figure, but i can't. this is my specific question, i checked [1] and [2] previously and also checked other question and didn't find any similar

plot.plots={'i':('Gf', 'Gg'), 'i1':('Tf','Tg')}
plot.plot()

plot.plots={'i':('VMaxf', 'Vmf', 'VMaxg', 'Vmg'), 'i1':('ic', 'ii') }
plot.plot()

do you understand me??
Regards

Revision history for this message
Best Jan Stránský (honzik) said :
#3

Hi Diego,

do you understand me?

Not really.. do you want 2 separate figures, each one with 2 subplots?
Making 4 subplots in 1 figure or 4 separate figures is easy, but with 2+2
combination I am not sure if it is possible in current implementation.. If
this is not the case, please try once more :-)

But anyway, plot in Yade is mainly to show user the results (so 1 figure
with 4 subplots should be OK), for serious plotting (for papers for
instance) I would use other tool (for me it is gnuplot). In the same way, I
use GUI to check how the simulation looks, but for real postprocessing I
use paraview..

cheers
Jan

2016-02-17 2:27 GMT+01:00 Diego Sotro <email address hidden>
:

> Question #285268 on Yade changed:
> https://answers.launchpad.net/yade/+question/285268
>
> Diego Sotro posted a new comment:
> thanks jan,
>
> firstly i believe that my level in YADE is noob, secondly i meant to
> say that i don't want use ONLY subplots, i'm working with extended
> granulometry (PSDSize) searching a critical hydraulics gradient when
> piping begins. my plot data is as follows:
>
>
> plot.addData(Vmf=velMeanFino, VMaxf=velMaxFino,Vmg=velMeanGros,
> VMaxg=velMaxGros, i=__builtin__.time1, i1=__builtin__.time1 , i2=O.iter,
> ic=__builtin__.icr, ii=it, Gf=Gfp, Gg=Ggp, Tf=tensf, Tg=tensg)
>
> and i want to plot two figure, but i can't. this is my specific
> question, i checked [1] and [2] previously and also checked other
> question and didn't find any similar
>
> plot.plots={'i':('Gf', 'Gg'), 'i1':('Tf','Tg')}
> plot.plot()
>
> plot.plots={'i':('VMaxf', 'Vmf', 'VMaxg', 'Vmg'), 'i1':('ic', 'ii') }
> plot.plot()
>
> do you understand me??
> Regards
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Diego Sotro (horusdnsr) said :
#4

Thanks Jan Stránský, that solved my question.