简体   繁体   中英

How to create a dot plot (not scatter plot) from this data?

I need help creating a dot plot in Python like the one from the image. The exercise consists on graphing the following data 74.001 , 74.003, 74.015, 74.000, 74.005, 74.004. I'm having some trouble with doing the dot plot because I can't find how to do it.

在此处输入图片说明

Here you go:

import matplotlib.pyplot as plt
y =[74.001 , 74.003, 74.015, 74.000, 74.005, 74.004]
fig = plt.plot(y,'o', fillstyle='none')

在此处输入图片说明

Next time you post a question, include a MRE (Minimum Reproducible Example) showing what you have done.

Using plotly and also defining x which was not provided.

import plotly.express as px
y =[74.001 , 74.003, 74.015, 74.000, 74.005, 74.004]
x =[12.4,12.5,12.5,12.6,12.7, 12.8]
px.scatter(x=x, y=y).update_traces(marker_symbol="circle-open", marker_line_width=3)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM