Python/altair

[Altair] Circle

Unlimited Jun 2024. 9. 21. 09:02

작성일자 : 2024-09-21

Ver 0.1.1

 

Circle

Circel Mark는 Point Mark와 유사하지만 (1) 모양 값이 항상 원으로 설정되어 있고 (2) 기본적으로 채워집니다.


속성

A circle mark definition can contain any standard mark properties and the following special properties:

속성 유형 설명
size anyOf(number, ExprRef) Default size for marks.
  • For point/circle/square, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.
  • For bar, this represents the band size of the bar, in pixels.
  • For text, this represents the font size, in pixels.
Default value:
  • 30 for point, circle, square marks; width/height’s step
  • 2 for bar marks with discrete dimensions;
  • 5 for bar marks with continuous dimensions;
  • 11 for text marks.

 


Scatter Plot with Circle

import altair as alt
from vega_datasets import data

source = data.cars.url

alt.Chart(source).mark_circle().encode(
   x=("Horsepower:Q"),
   y=("Miles_per_Gallon:Q"),
)