Make_plots.py problems

49 views
Skip to first unread message

chichi zhao

unread,
Sep 18, 2023, 2:43:34 AM9/18/23
to dadi-user
Hello, dadi-users. recent days, I got the problem when I try ploting the dadi 3d plots. The main question of this is the problems for using the matplotlib/color.py 

  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/matplotlib/colors.py", line 1724, in inverse
    raise ValueError("Invalid vmin or vmax")
ValueError: Invalid vmin or vmax

 The main command line that I used are the following 
"
Plotting_Functions.Plot_3D(fs, model_fit, prefix, "sim_split_sym_mig_all",vmin_val=None)
"
in my perspective, I think it may relative to some factors (python version)
IF YOU HAVE ANY IDEA ABOUT IT , APPRECIATE IT, THANKS FOR HELP

the following are the output informations.

"
============================================================================

Data for site frequency spectrum:

Projection: [80, 34, 72]
Sample sizes: [80 34 72]
Sum of SFS: 1082329.0

============================================================================

============================================================================
Fitting model 'refugia_adj_3' to empirical data...
============================================================================

Input parameters = [0.44700684, 0.38339181, 3.09443241, 2.76340481, 7.56458127, 0.16392666, 28.91735005, 0.1107808, 0.49203038, 8.86842841]

WARNING:Numerics:Extrapolation may have failed. Check resulting frequency spectrum for unexpected results.
1082326.0 1082329.0
WARNING:Inference:Model is masked in some entries where data is not.
WARNING:Inference:Number of affected entries is 104538. Sum of data in those entries is 1.08233e+06:
                        Likelihood = -23.9
                        AIC = 67.8
                        Theta = 9,657.73
                        Chi-Squared = 5,256.43

============================================================================
Creating plots
============================================================================


Plotting East_Middle_West_refugia_adj_3.pdf

NOTE - CLOSE PLOT TO ADVANCE.
Traceback (most recent call last):
  File "/home/chichi/data/china/china_old/easysfs/dadi_pipeline/Plotting2/Make_Plots.py", line 255, in <module>
    Plotting_Functions.Plot_3D(fs, model_fit, prefix, "refugia_adj_3",vmin_val=None)
  File "/home/chichi/data/china/china_old/easysfs/dadi_pipeline/Plotting2/Plotting_Functions.py", line 127, in Plot_3D
    dadi.Plotting.plot_3d_comp_multinom(model_fit, fs, resid_range = 3)
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/dadi/Plotting.py", line 534, in plot_3d_comp_multinom
    plot_3d_comp_Poisson(model, data, vmin=vmin, vmax=vmax,
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/dadi/Plotting.py", line 643, in plot_3d_comp_Poisson
    plot_single_2d_sfs(marg_data, vmin=vmin, vmax=vmax, pop_ids=curr_ids[0],
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/dadi/Plotting.py", line 182, in plot_single_2d_sfs
    cb = ax.figure.colorbar(mappable, extend=extend, format=format)
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/matplotlib/figure.py", line 1293, in colorbar
    cb = cbar.Colorbar(cax, mappable, **cb_kw)
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/matplotlib/_api/deprecation.py", line 384, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/matplotlib/colorbar.py", line 402, in __init__
    self._reset_locator_formatter_scale()
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/matplotlib/colorbar.py", line 1173, in _reset_locator_formatter_scale
    self._process_values()
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/matplotlib/colorbar.py", line 1111, in _process_values
    b = self.norm.inverse(b)
  File "/home/chichi/anaconda3/envs/bio/lib/python3.10/site-packages/matplotlib/colors.py", line 1724, in inverse
    raise ValueError("Invalid vmin or vmax")
ValueError: Invalid vmin or vmax
"

Ryan Gutenkunst

unread,
Sep 19, 2023, 5:36:35 PM9/19/23
to dadi...@googlegroups.com
Hello Chichi,

You’re using the Portik pipeline it appears, which I’m not familiar with all the details of. That said, my guess is that the method is failing due to passing vein_val=None. You likely need to pick a value for vmin.

Best,
Ryan
> --
> You received this message because you are subscribed to the Google Groups "dadi-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dadi-user+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dadi-user/766acded-e22d-4baf-8d26-d162464e5fb5n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages