Skip to content

Commit

Permalink
fix math syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Cleveland committed Jan 6, 2024
1 parent 81c73f1 commit c67c027
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions opppy/plot_dump_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def plot_2d(self, args, dictionary):
data = np.array(dictionary[data_name])*args.scale_value
if(args.log_scale):
bias = abs(min(data));
data = [ math.log10(val+bias) if val+bias>0.0 else 0.0 for val in data]
data = [ log10(val+bias) if val+bias>0.0 else 0.0 for val in data]
x = np.array(dictionary[xname])*args.scale_x
y = np.array(dictionary[yname])*args.scale_y

Expand Down Expand Up @@ -1015,7 +1015,7 @@ def init_contour():
if(args.log_scale):
bias = v.min()
bias = 0.0 if bias>0.0 else abs(bias)
v = np.array([ [math.log10(val+bias) if (val+bias)>0.0 else 0.0
v = np.array([ [log10(val+bias) if (val+bias)>0.0 else 0.0
for val in vals] for vals in v])
x = np.array(data[xname])*args.scale_x
y = np.array(data[yname])*args.scale_y
Expand Down Expand Up @@ -1074,8 +1074,8 @@ def init_contour():
PyPloter.legend(loc='best')

if(args.data_bounds):
vmin = args.data_bounds[0] if not args.log_scale else math.log10(args.data_bounds[0]+bias)
vmax = args.data_bounds[1] if not args.log_scale else math.log10(args.data_bounds[1]+bias)
vmin = args.data_bounds[0] if not args.log_scale else log10(args.data_bounds[0]+bias)
vmax = args.data_bounds[1] if not args.log_scale else log10(args.data_bounds[1]+bias)

imshow = PyPloter.imshow(series_pair.grid[0][dname], extent=(xmin,xmax,ymin,ymax), vmin=vmin, vmax=vmax, origin='lower', animated=True, cmap='jet')
PyPloter.colorbar()
Expand Down

0 comments on commit c67c027

Please sign in to comment.