Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing area coloring #2195

Merged
merged 23 commits into from
Jul 28, 2023
Merged

Fixing area coloring #2195

merged 23 commits into from
Jul 28, 2023

Conversation

germa89
Copy link
Collaborator

@germa89 germa89 commented Jul 20, 2023

As the title.

Now you can do something like:

from ansys.mapdl.core import launch_mapdl
import numpy as np

mapdl = launch_mapdl()
mapdl.clear()
mapdl.prep7()
mapdl.block(0,1,0,1,0,1)

for each in [
    True, 
   "red",
   ["red", "green", "blue", "yellow", "white", "purple"],
   [[255,255,255], [255,255,0], [255,0,0], [0,255,0], [0,255,255],[0,0,0]],
   255*np.array([[1,1,1], [1,1,0], [1,0,0], [0,1,0], [0,1,1],[0,0,0]]),
   ]:
    color_areas = each 
    mapdl.aplot(vtk=True, color_areas = color_areas)

Close #2011

@germa89 germa89 requested a review from clatapie July 20, 2023 15:13
@github-actions github-actions bot added Enhancement Improve any current implemented feature New Feature Request or proposal for a new feature labels Jul 20, 2023
@germa89 germa89 requested a review from mikerife July 20, 2023 15:13
@germa89 germa89 self-assigned this Jul 20, 2023
@germa89 germa89 added the BUG Issue, problem or error in PyMAPDL label Jul 20, 2023
@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Merging #2195 (bb63332) into main (55e0e2e) will increase coverage by 0.95%.
Report is 61 commits behind head on main.
The diff coverage is 94.63%.

@@            Coverage Diff             @@
##             main    #2195      +/-   ##
==========================================
+ Coverage   86.43%   87.39%   +0.95%     
==========================================
  Files          45       45              
  Lines        7971     8224     +253     
==========================================
+ Hits         6890     7187     +297     
+ Misses       1081     1037      -44     

tests/test_plotting.py Outdated Show resolved Hide resolved
germa89 and others added 3 commits July 26, 2023 13:43
@germa89
Copy link
Collaborator Author

germa89 commented Jul 28, 2023

I have tested locally again and the behaviour is as expected. I will open an issue on PyVista.

@germa89 germa89 merged commit 6705307 into main Jul 28, 2023
22 checks passed
@germa89 germa89 deleted the feat/aplot-colouring branch July 28, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Issue, problem or error in PyMAPDL Enhancement Improve any current implemented feature New Feature Request or proposal for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turning on area colors results in each underlying mesh face being a different color
3 participants