Contour plots (panels.plot_shell)#
- panels.plot_shell.plot_shell(shell, c, invert_y=False, vec='w', deform_u=False, deform_u_sf=100.0, filename='', ax=None, figsize=(3.5, 2.0), save=True, title='', colorbar=False, cbar_nticks=2, cbar_format=None, cbar_title='', cbar_fontsize=10, colormap='jet', aspect='equal', clean=True, dpi=400, texts=[], xs=None, ys=None, gridx=300, gridy=300, num_levels=400, vecmin=None, vecmax=None, plot_offset_x=0.0, plot_offset_y=0.0, NLgeom=True)#
Contour plot for a Ritz constants vector.
The field
vecis calculated withShell.uvw(),Shell.strain()orShell.stress(), which updateshell.fieldsandshell.plot_mesh; afterwards the entries ofshell.fieldsthat were notNonebefore the call are restored, the others keep the calculated values. The plot shows \(x\) along the vertical axis and \(y\) along the horizontal axis, and the horizontal axis is inverted. Log messages are printed. WhensaveisTruethe figure is written tofilenameand closed withmatplotlib.pyplot.close().- Parameters:
- shell
Shell The shell whose field is plotted.
- carray_like
The Ritz constants that will be used to compute the field contour.
- vecstr, optional
Can be one of the components:
Displacement:
'u','v','w','phix','phiy'Strain:
'exx','eyy','gxy','kxx','kyy','kxy','gyz','gxz'Stress:
'Nxx','Nyy','Nxy','Mxx','Myy','Mxy','Qy','Qx'
Default
'w'. The transverse shear components exist only for the models based on shear deformation theories.- deform_ubool, optional
If
Truethe contour plot will look deformed. The plotted \(x\) of each point is decreased bydeform_u_sf*uand the plotted \(y\) increased bydeform_u_sf*v. DefaultFalse.- deform_u_sffloat, optional
The scaling factor used to deform the contour. Dimensionless. Default
100..- invert_ybool, optional
Inverts the \(y\) axis of the plot. Default
False.- savebool, optional
Flag telling whether the contour should be saved to an image file. Default
True, ignored whenaxis given.- dpiint, optional
Resolution of the saved file in dots per inch. Default
400.- filenamestr, optional
The file name for the generated image file. If no value is given,
'test.png'is used. Default''.- axAxesSubplot, optional
When
axis given, the contour plot will be created inside it. DefaultNone, a new figure is created.- figsizetuple, optional
The figure size given by
(width, height), in inches, used only for a new figure. Default(3.5, 2.).- titlestr, optional
If any string is given it is added as title to the contour plot. Default
''.- colorbarbool, optional
If a colorbar should be added to the contour plot. Default
False.- cbar_nticksint, optional
Number of ticks added to the colorbar. Default
2.- cbar_format[ None | format string | Formatter object ], optional
See the
matplotlib.pyplot.colorbardocumentation. DefaultNone.- cbar_titlestr, optional
Colorbar title. If
cbar_title == ''no title is added. Default''.- cbar_fontsizeint, optional
Fontsize of the colorbar labels. Default
10.- colormapstring, optional
Name of a matplotlib available colormap. An invalid name, or a value that is not a string, gives
'jet'with a warning. Default'jet'.- aspectstr, optional
String that will be passed to the
AxesSubplot.set_aspect()method. Default'equal'.- cleanbool, optional
Clean axes ticks, grids, spines etc. Default
True.- textslist of dict, optional
Keyword arguments of
matplotlib.axes.Axes.text(), one dictionary per text, placed in axes coordinates (transform=ax.transAxes). Default[].- xsarray_like, optional
The \(x\) positions where to calculate the displacement field. Default is
Noneand the method_default_fieldis used.- ysarray_like, optional
The
ypositions where to calculate the displacement field. Default isNoneand the method_default_fieldis used.- gridxint, optional
Number of points along the \(x\) axis where to calculate the displacement field. Default
300.- gridyint, optional
Number of points along the \(y\) where to calculate the displacement field. Default
300.- num_levelsint, optional
Number of contour levels (higher values make the contour smoother). Default
400.- vecminfloat, optional
Minimum value for the contour scale (useful to compare with other results). If not specified it will be taken from the calculated field. Default
None.- vecmaxfloat, optional
Maximum value for the contour scale. If not specified it will be taken from the calculated field. Default
None.- plot_offset_x, plot_offset_yfloat, optional
Offsets added to the coordinates
xandyof the plotted points, lengths. Default0..- NLgeombool, optional
Passed to
Shell.stress(), used only for the stresses. DefaultTrue.
- shell
- Returns:
- axmatplotlib.axes.Axes
The Matplotlib object that can be used to modify the current plot if needed.
- Raises:
- ValueError
If
vecis not one of the components above, or ifaxis not amatplotlib.axes.Axes.