# Discrete Color Map in graph\_objects Box plot

**URL:** <https://community.plotly.com/t/discrete-color-map-in-graph-objects-box-plot/46040>\
**Category:** 📊 Plotly Python\
**Created:** [October 14, 2020, 4:04pm UTC](https://community.plotly.com/t/discrete-color-map-in-graph-objects-box-plot/46040 "2020-10-14T16:04:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmesser](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@cmesser](https://community.plotly.com/u/cmesser)\
**Post date:** [October 14, 2020, 4:04pm UTC](https://community.plotly.com/t/discrete-color-map-in-graph-objects-box-plot/46040/1 "2020-10-14T16:04:29Z")

</div>

I am attempting to plot 1-D data vertically for multiple categorical groups, with the points colored based on a different set of data. I have gotten the chart how I want it using the Express box plot, however I want to add a heatmap above (using subplot traces) but Express apparently does not support traces currently.

```auto
fig = px.box(samples, y=y_axis, x='level_0', color=marker_color,
             category_orders={marker_color: marker_color_var.to_list()[::-1]},
             boxmode='overlay', color_discrete_map=vals_colors,
             points="all")
fig.update_traces(line={"color": "rgba(255,255,255,0)"}, jitter=0.03, pointpos=0, fillcolor="rgba(255,255,255,0)")
fig.update_layout(showlegend=False)
fig.show()

```

Is there a way to use this express box plot as a subplot trace? Alternatively, I have also tried to recreate this plot using the graph\_objects box plot, however there is no parameter corresponding to color\_discrete\_map. Is it possible to use data to color the points in a box plot?

 ![newplot (2)](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/3/3ac0fdfba5f4ac02d979206468e74703f1ef100c.png)
