Plotting API - Parallel coordinates#
This notebook provides the user a guide to how a parallel coordinates plot can be shown using a Blueback Investigation. Check out the API documentation to view all the functions available for the Parallel Coordinates view:
Import dependencies :
[1]:
import cegalprizm.investigator as investigator
from cegalprizm.investigator import InvestigatorConnection
from cegalprizm.investigator.views import ParallelCoordinatesView
Connect to investigator and assign the investigation to a variable :
[2]:
invconnection = InvestigatorConnection(use_licensed_features=True)
inv = invconnection.investigation_from_file("Wells.invpy")
To create a parallel coordinates view of the investigation use the ParallelCoordinatesView() function with the investigation(inv) as the input parameter. To plot the parallel coordinates plot, use the .plot() function which takes as input parameters the specific view. You can also provide the width (defaults to 900) and the height (defaults to 600) of the figure.
[3]:
parcoord_view=ParallelCoordinatesView(inv)
investigator.plot(parcoord_view)
[3]:

You can add a legend to see from which well each point comes using the show_legend() function:
[4]:
parcoord_view=ParallelCoordinatesView(inv)
parcoord_view.show_legend(True)
investigator.plot(parcoord_view)
[4]:

You can set the priority of the dataset (the order in which the points are plotted) using the the .set_dataset_priority function:
[5]:
parcoord_view=ParallelCoordinatesView(inv)
parcoord_view.show_legend(True)
parcoord_view.set_dataset_priority(['Wells/B9','Wells/B4','Wells/B2','Wells/B8'])
investigator.plot(parcoord_view)
[5]:

By default, the Parallel Coordinates view will display all the points in your investigation coming from all the wells. You can select which well you want to visualize using the .set_datasets_visible() function which takes as an input a list of strings containing the well names. You can have one or multiple wells selected :
[6]:
parcoord_view=ParallelCoordinatesView(inv)
parcoord_view.show_legend(True)
parcoord_view.set_datasets_visible(['Wells/B4'])
investigator.plot(parcoord_view)
[6]:

By default, the Parallel Coordinates view will plot all the data points in the investigation. You can select the data you want to plot using the .set_dimensions function:
[7]:
parcoord_view=ParallelCoordinatesView(inv)
parcoord_view.show_legend(True)
parcoord_view.set_datasets_visible(['Wells/B4'])
parcoord_view.set_dimensions(["Perm","Porosity"])
investigator.plot(parcoord_view)
[7]:

You can select the color template using the .set_color_by function. To add the colorscale use the .show_colorscale function, set to true:
[8]:
parcoord_view=ParallelCoordinatesView(inv)
parcoord_view.set_color_by('Perm')
parcoord_view.show_colorscale(True)
investigator.plot(parcoord_view)
[8]:

To change the colorscale location use the set_colorscale_location() . First input parameter is a boolean value that specifies if the color scale should be inside the view port (True) or not (False). The second input parameter is a string value that specifies the location (‘top-left’, ‘top-right’, ‘bottom-left’, ‘bottom-right’). Note that for this view the colorscale can only be placed to the right or left although the input parameters refer to top and bottom as well.
[9]:
parcoord_view=ParallelCoordinatesView(inv)
parcoord_view.set_color_by('Perm')
parcoord_view.show_colorscale(True)
parcoord_view.set_colorscale_location(True, 'top-left')
investigator.plot(parcoord_view)
[9]:

You can also use the color template of discrete properties :
[10]:
parcoord_view=ParallelCoordinatesView(inv)
parcoord_view.show_legend(True)
parcoord_view.set_color_by('Facies')
investigator.plot(parcoord_view)
[10]:

Moreover, you can split a Parallel Coordinates view by any discrete property. In the example bellow we generated a Parallel Coordinates , colored by facies, for each of the zones in our investigation (Undefined, Cret, T3, T2, T1, N2, N1) using the set_split_by() function:
[11]:
parcoord_view=ParallelCoordinatesView(inv)
parcoord_view.show_legend(True)
parcoord_view.set_color_by('Facies')
parcoord_view.set_split_by('Zones (hierarchy)')
investigator.plot(parcoord_view)
[11]:

The .copy() function returns a copy of the parallel coordinates view. This can be used to ensure that a common view setup can be the applied to multiple related views.