Skip to content

Commit

Permalink
Fixing plots in the documentation (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: Roberto Pastor Muela <[email protected]>
  • Loading branch information
clatapie and RobPasMue authored Mar 23, 2023
1 parent cf41a87 commit e02384f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions examples/scipy_sparse_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

out = mm._mapdl.input(vmfiles["vm153"])
k = mm.stiff(fname="PRSMEMB.full")
k

################################################################################
# Copy AnsMath sparse matrix to SciPy CSR matrix and plot
Expand All @@ -36,7 +35,7 @@
# graph of the sparse matrix.

pk = k.asarray()
plt.spy(pk, color="orange")
plt.spy(pk, color="orange", markersize=3)
plt.title("AnsMath sparse matrix")
plt.show()

Expand Down
3 changes: 2 additions & 1 deletion examples/solve_dense_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@
# Plot the elapsed times for PyAnsys Math and Numpy to solve the dense
# matrix linear system.
#
max_time = max(pymath_time, numpy_time)
fig = plt.figure(figsize=(12, 10))
ax = plt.axes()
x = ["PyAnsys Math", "NumPy"]
y = [pymath_time, numpy_time]
plt.title("Elapsed time to solve the linear system")
plt.ylim([0, numpy_time + 1])
plt.ylim([0, max_time + 0.2 * max_time])
plt.ylabel("Elapsed time (s)")
ax.bar(x, y, color="orange")
plt.show()
Expand Down
2 changes: 1 addition & 1 deletion examples/solve_sparse_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# graph of the sparse matrix.

pk = k.asarray()
plt.spy(pk, color="orange")
plt.spy(pk, color="orange", markersize=3)
plt.title("AnsMath sparse matrix")
plt.show()

Expand Down

0 comments on commit e02384f

Please sign in to comment.