pyleecan.Functions.Plot.plot_2D module

plot_2D(Xdatas, Ydatas, legend_list=[''], color_list=None, linestyle_list=['-'], linewidth_list=[2], title='', xlabel='', ylabel='', fig=None, ax=None, is_logscale_x=False, is_logscale_y=False, is_disp_title=True, is_grid=True, type_plot='curve', fund_harm=None, x_min=None, x_max=None, y_min=None, y_max=None, xticks=None, save_path=None, barwidth=100, is_show_fig=None, win_title=None)[source]

Plots a 2D graph (curve, bargraph or barchart) comparing fields in Ydatas

Parameters:
  • Xdatas (ndarray) – array of x-axis values

  • Ydatas (list) – list of y-axes values

  • legend_list (list) – list of legends

  • color_list (list) – list of colors to use for each curve

  • linewidth_list (list) – list of line width to use for each curve

  • title (str) – title of the graph

  • xlabel (str) – label for the x-axis

  • ylabel (str) – label for the y-axis

  • fig (Matplotlib.figure.Figure) – existing figure to use if None create a new one

  • ax (Matplotlib.axes.Axes object) – ax on which to plot the data

  • is_logscale_x (bool) – boolean indicating if the x-axis must be set in logarithmic scale

  • is_logscale_y (bool) – boolean indicating if the y-axis must be set in logarithmic scale

  • is_disp_title (bool) – boolean indicating if the title must be displayed

  • is_grid (bool) – boolean indicating if the grid must be displayed

  • type_plot (str) – type of 2D graph : “curve”, “bargraph”, “barchart” or “quiver”

  • fund_harm (float) – frequency/order/wavenumber of the fundamental harmonic that must be displayed in red in the fft

  • x_min (float) – minimum value for the x-axis

  • x_max (float) – maximum value for the x-axis

  • y_min (float) – minimum value for the y-axis

  • y_max (float) – maximum value for the y-axis

  • xticks (list) – list of ticks to use for the x-axis

  • save_path (str) – full path including folder, name and extension of the file to save if save_path is not None

  • barwidth (float) – barwidth scaling factor, only if type_plot = “bargraph”

  • is_show_fig (bool) – True to show figure after plot

  • win_title (str) – Title of the plot window