Skip to content

Commit

Permalink
[BC] plot_2D axis limits
Browse files Browse the repository at this point in the history
This PR fix some axis limits issue, when there are multiple data with different ranges in the same figure.
  • Loading branch information
SebGue authored Aug 12, 2021
1 parent c708f68 commit f5f79ca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions SciDataTool/Functions/Plot/plot_2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,16 @@ def get_cumulated_array(data, **kwargs):

ax.set_xlabel(xlabel)
ax.set_ylabel(ylabel)
ax.set_xlim([x_min, x_max])
ax.set_ylim([y_min, y_max])

if x_max is not None:
ax.set_xlim(right=x_max)
if x_min is not None:
ax.set_xlim(left=x_min)

if y_max is not None:
ax.set_ylim(top=y_max)
if y_min is not None:
ax.set_ylim(bottom=y_min)

if is_logscale_x:
ax.set_xscale("log")
Expand Down

0 comments on commit f5f79ca

Please sign in to comment.